コード例 #1
0
 public function run()
 {
     $permissions = array('Manage Users', 'Manage Articles', 'Manage Pages', 'Manage Categories', 'Manage Settings', 'Manage Roles', 'Manage Permissions');
     foreach ($permissions as $permission) {
         Permission::create(['name' => $permission, 'slug' => $permission, 'description' => $permission]);
     }
     $permissions = Permission::lists('id');
     Role::find(1)->permissions()->attach($permissions);
 }
コード例 #2
0
ファイル: RoleFormComposer.php プロジェクト: wolftungvn/admin
 public function compose($view)
 {
     $permissions = Permission::lists('name', 'id');
     $view->with(compact('permissions'));
 }