Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ Thumbs.db

# sublime phpintel plugin
/.phpintel

### CACHE ###
.phpunit.result.cache
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ language: php
dist: trusty

php:
- 5.5
- 5.6
- 7.0
- hhvm
- 7.2
- 7.3

matrix:
fast_finish: true
allow_failures:
- php: 7.0
- php: 7.3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this safer to put php: 7.2


before_script:
- travis_retry composer self-update
Expand Down
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ENTRUST (Laravel 5 Package)
# ENTRUST (Laravel 6 Package)

[![Build Status](https://travis-ci.org/Zizaco/entrust.svg)](https://travis-ci.org/Zizaco/entrust)
[![Version](https://img.shields.io/packagist/v/Zizaco/entrust.svg)](https://packagist.org/packages/zizaco/entrust)
Expand All @@ -7,11 +7,14 @@

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/cc4af966-809b-4fbc-b8b2-bb2850e6711e/small.png)](https://insight.sensiolabs.com/projects/cc4af966-809b-4fbc-b8b2-bb2850e6711e)

Entrust is a succinct and flexible way to add Role-based Permissions to **Laravel 5**.
Entrust is a succinct and flexible way to add Role-based Permissions to **Laravel 6**.

If you are looking for the Laravel 4 version, take a look [Branch 1.0](https://github.com/Zizaco/entrust/tree/1.0). It
contains the latest entrust version for Laravel 4.

If you are looking for the Laravel 5 version, take a look [Tag 1.7.0](https://github.com/Zizaco/entrust/tree/1.7.0). It
contains the latest entrust version for Laravel 5.

## Contents

- [Installation](#installation)
Expand All @@ -37,10 +40,10 @@ contains the latest entrust version for Laravel 4.

## Installation

1) In order to install Laravel 5 Entrust, just add the following to your composer.json. Then run `composer update`:
1) In order to install Laravel 6 Entrust, just add the following to your composer.json. Then run `composer update`:

```json
"zizaco/entrust": "5.2.x-dev"
"zizaco/entrust": "6.0.1-dev"
```

2) Open your `config/app.php` and add the following to the `providers` array:
Expand Down Expand Up @@ -115,7 +118,7 @@ After the migration, four new tables will be present:

#### Role

Create a Role model inside `app/models/Role.php` using the following example:
Create a Role model inside `app/Role.php` using the following example:

```php
<?php namespace App;
Expand All @@ -136,7 +139,7 @@ Both `display_name` and `description` are optional; their fields are nullable in

#### Permission

Create a Permission model inside `app/models/Permission.php` using the following example:
Create a Permission model inside `app/Permission.php` using the following example:

```php
<?php namespace App;
Expand Down Expand Up @@ -515,17 +518,6 @@ If the user is not logged the return will also be `false`.

## Troubleshooting

If you encounter an error when doing the migration that looks like:

```
SQLSTATE[HY000]: General error: 1005 Can't create table 'laravelbootstrapstarter.#sql-42c_f8' (errno: 150)
(SQL: alter table `role_user` add constraint role_user_user_id_foreign foreign key (`user_id`)
references `users` (`id`)) (Bindings: array ())
```

Then it's likely that the `id` column in your user table does not match the `user_id` column in `role_user`.
Make sure both are `INT(10)`.

Comment on lines -518 to -528

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these changes to the readme file aren't necessary like removing of this and model namespacing.

When trying to use the EntrustUserTrait methods, you encounter the error which looks like

Class name must be a valid object or a string
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
}
],
"require": {
"php": ">=5.5.0",
"illuminate/console": "~5.0",
"illuminate/support": "~5.0",
"illuminate/cache": "~5.0"
"php": ">=7.2.0",
"illuminate/console": "~6.0",
"illuminate/support": "~6.0",
"illuminate/cache": "~6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.1",
"phpunit/phpunit": "~8.0",
"mockery/mockery": "dev-master",
"illuminate/database": "~5.0",
"illuminate/database": "~6.0",
"sami/sami": "dev-master"
},
"autoload": {
Expand Down
Loading