Ejemplo n.º 1
0
 /**
  * @return Role
  */
 private function createAdminRole()
 {
     $owner = new Role();
     $owner->name = 'system-administrator';
     $owner->display_name = 'System Administrator';
     $owner->description = 'The General admin user';
     $owner->save();
     return $owner;
 }
Ejemplo n.º 2
0
 /**
  * Assing permissions to a Role
  * @param $roleId
  * @param $permissions
  * @return bool
  */
 public function assignPermissionsToRole($roleId, $permissions)
 {
     $roles = Role::findOrFail($roleId);
     $roles->perms()->attach($permissions);
     return true;
 }