Example #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $permissions = R::allPermissions();
     foreach ($permissions as $name => $display_name) {
         Permission::create(compact('name', 'display_name'));
     }
 }
Example #2
0
 /**
  * define all permissions
  *
  * @return void
  */
 public function definePermissions(Gate $gate)
 {
     $permissions = Role::allPermissions();
     foreach ($permissions as $permission => $value) {
         $gate->define($permission, function (User $user) use($permission) {
             return $user->hasPermission($permission);
         });
     }
 }