-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major version to work with Laravel 6 #958
Open
bakome
wants to merge
2
commits into
Zizaco:master
Choose a base branch
from
bakome:major-version-to-work-with-laravel-6
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,6 @@ Thumbs.db | |
|
||
# sublime phpintel plugin | ||
/.phpintel | ||
|
||
### CACHE ### | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
@@ -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) | ||
|
@@ -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: | ||
|
@@ -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; | ||
|
@@ -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; | ||
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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