Get the given authority's roles.
public getRoles ( |
||
$authority | ||
리턴 |
/** * Get the given user's roles. * * @param \Illuminate\Database\Eloquent\Model $user * @return \Illuminate\Support\Collection */ public function getRoles(Model $user) { $key = $this->tag . '-roles-' . $user->getKey(); return $this->cache->sear($key, function () use($user) { return parent::getRoles($user); }); }
/** * Get the given authority's roles. * * @param \Illuminate\Database\Eloquent\Model $authority * @return \Illuminate\Support\Collection */ public function getRoles(Model $authority) { $key = $this->getCacheKey($authority, 'roles'); return $this->sear($key, function () use($authority) { return parent::getRoles($authority); }); }