Zizaco / entrust

Role-based Permissions for Laravel 5
MIT License
6.05k stars 1.29k forks source link

Does this package working in 5.6 version ? #905

Open amrokhudair opened 6 years ago

amrokhudair commented 6 years ago

Hi. I want to ask if this package working in laravel 5.6 ? Thank you in advanced.

v1r0x commented 6 years ago

I switched to Laravel 5.6 and it seems to run without errors. :)

anis-bedhiafi commented 6 years ago

Yes it does work. I am using it in my Laravel 5.6 project.

MaungC commented 6 years ago

@ amrokhudair What error show you.

jianhuawang commented 6 years ago

@anis-bedhiafi Did you run : php artisan entrust:migration ? I had a error: ReflectionException : Method Zizaco\Entrust\MigrationCommand::handle() does not exist

So I think entrust is not ready all for Laravel 5.6.

I fixed it by add the following code in class Zizaco\Entrust\MigrationCommand. and then, it work well public function handle() { $this->fire(); }

anis-bedhiafi commented 6 years ago

@terrywamg I had alot of problems with this package. I don't recommend it. Here is why:

https://laravel-news.com/two-best-roles-permissions-packages

https://github.com/spatie/laravel-permission https://github.com/JosephSilber/bouncer

I am using laravel-permission with v5.6. It is an awesome package. You should give it a try.

1e4 commented 6 years ago

@anis-bedhiafi That article is pretty outdated, for example Bouncer allows syncing for roles and abilities, where in the article that was the main benefit of going with Spatie.

gbryant200 commented 6 years ago

Does Laravel 5.6 use the auto-load features for this package or does the app.php file still need manually updated for the provider and alias?

anis-bedhiafi commented 6 years ago

@gbryant200 it is actually called auto discovery. Starting from v5.5 Laravel will lookup the provider for you. To answer your question, just require the package with composer. Laravel will do the rest.

MaherSakka commented 6 years ago

I have troubles when using the instruction: Entrust::routeNeedsRole('admin/advanced*', 'owner', Redirect::to('/home')); InvalidArgumentException: Attribute [filter] does not exist. Cause:

Route filters have been deprecated in preference of middleware and was removed entirely with the release of Laravel 5.2 in December 2015

salamat1307 commented 6 years ago

In laravel 5.5 withRole method? Is supported withRole method for v5.5 laravel?

musman92 commented 6 years ago

@anis-bedhiafi i try laravel-permission it gave me a error "model_id cannot be null", when i assign a role to user and any help

anonymouse703 commented 5 years ago

@MaherSakka did you already solved it? I have the same problem too..