/** * 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); }); }
/** * Check if the user has all of the given roles. * * @param string $role * @return bool */ public function all($role) { $roles = func_get_args(); return $this->clipboard->checkRole($this->user, $roles, 'and'); }