From 15f265d8aa976fc1b5efae5cb4da4a9e9dd3c6f5 Mon Sep 17 00:00:00 2001 From: Anton Date: Sun, 25 Mar 2018 10:56:57 +0800 Subject: [PATCH] added default ttl to roles cache --- src/Entrust/Traits/EntrustUserTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entrust/Traits/EntrustUserTrait.php b/src/Entrust/Traits/EntrustUserTrait.php index c799bbeb..78724906 100644 --- a/src/Entrust/Traits/EntrustUserTrait.php +++ b/src/Entrust/Traits/EntrustUserTrait.php @@ -25,7 +25,7 @@ public function cachedRoles() $userPrimaryKey = $this->primaryKey; $cacheKey = 'entrust_roles_for_user_'.$this->$userPrimaryKey; if(Cache::getStore() instanceof TaggableStore) { - return Cache::tags(Config::get('entrust.role_user_table'))->remember($cacheKey, Config::get('cache.ttl'), function () { + return Cache::tags(Config::get('entrust.role_user_table'))->remember($cacheKey, Config::get('cache.ttl', 60), function () { return $this->roles()->get(); }); } @@ -305,7 +305,7 @@ public function detachRoles($roles=null) } /** - *Filtering users according to their role + *Filtering users according to their role * *@param string $role *@return users collection