예제 #1
0
파일: Lair.php 프로젝트: jeremytubbs/lair
 /**
  * Get the current permissions.
  *
  * @return \Illuminate\Database\Eloquent\Collection
  */
 protected function getPermissions()
 {
     return $this->cache->rememberForever($this->cacheKey, function () {
         return Permission::with('roles')->get();
     });
 }
예제 #2
0
파일: Role.php 프로젝트: jeremytubbs/lair
 /**
  * Revoke the given permission.
  *
  * @param $permission
  * @return mixed
  */
 public function removePermission($permission)
 {
     return $this->permissions()->detach(Permission::whereName($permission)->firstOrFail());
 }