Get a list of the authority's abilities.
public getAbilities ( |
||
$authority | ||
$allowed | boolean | |
return | Illuminate\Database\Eloquent\Collection |
/** * Get the given user's abilities. * * @param \Illuminate\Database\Eloquent\Model $user * @return \Illuminate\Database\Eloquent\Collection */ public function getAbilities(Model $user) { $key = $this->tag . '-abilities-' . $user->getKey(); if ($abilities = $this->cache->get($key)) { return $this->deserializeAbilities($abilities); } $abilities = parent::getAbilities($user); $this->cache->forever($key, $this->serializeAbilities($abilities)); return $abilities; }
/** * Get a fresh copy of the given authority's abilities. * * @param \Illuminate\Database\Eloquent\Model $authority * @param bool $allowed * @return \Illuminate\Database\Eloquent\Collection */ public function getFreshAbilities(Model $authority, $allowed) { return parent::getAbilities($authority, $allowed); }