getRoles() публичный Метод

Get the given authority's roles.
public getRoles ( Model $authority ) : Collection
$authority Illuminate\Database\Eloquent\Model
Результат Illuminate\Support\Collection
Пример #1
0
 /**
  * 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);
     });
 }
Пример #2
0
 /**
  * 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);
     });
 }