public cachedRoles ( ) : Illuminate\Database\Eloquent\Collection | ||
Результат | Illuminate\Database\Eloquent\Collection |
public function cachedRoles()
{
$cacheKey = 'laratrust_roles_for_user_' . $this->getKey();
return Cache::remember($cacheKey, Config::get('cache.ttl', 60), function () {
return $this->roles()->get();
});
}