Ref:
https://www.youtube.com/watch?v=Kas2w2DBuFg
https://github.com/mschwarzmueller/laravel-playground
My:https://github.com/lovenery/laravel-simple-acl
–
Great!
shinobi
https://github.com/caffeinated/shinobi
GUI
https://github.com/SmarchSoftware/watchtower
Entrust
Ref:https://github.com/Zizaco/entrust
Install
照著Readme做,但composer require zizaco/entrust:dev-master
5.2.x-dev
有不能用file cache的問題QQ
以下也是5.2.x-dev
的問題
在php artisan entrust:migration
之前就要
|
|
不然你就要$table->foreign('user_id')->references('id')->on('')
to$table->foreign('user_id')->references('id')->on('users')
才能php artisan migrate
不能php artisan migrate:reset
的時後記得composer dump-autoload
Configuration
php artisan make:auth
php artisan make:model Role
php artisan make:model Permission
|
|
|
|
This will enable the relation with Role
and add the following methods roles()
, hasRole($name)
, can($permission)
, and ability($roles, $permissions, $options)
within your User
model.
記得composer dump-autoload
Play
php artisan make:seeder RolesTableSeeder
|
|
$this->call(RolesTableSeeder::class);