src/Platfourm/User/Models/Eloquent/Role.php 1 location
|
@@ 32-38 (lines=7) @@
|
29 |
|
|
30 |
|
protected $dates = ['deleted_at']; |
31 |
|
|
32 |
|
public function cachedPermissions() |
33 |
|
{ |
34 |
|
$cacheKey = 'entrust_permissions_for_role_' . $this->getKey(); |
35 |
|
return Cache::remember($cacheKey, Config::get('cache.ttl'), function () { |
36 |
|
return $this->permissions()->get(); |
37 |
|
}); |
38 |
|
} |
39 |
|
|
40 |
|
/** |
41 |
|
* Checks if the role has a permission by its name. |
src/Platfourm/User/Models/Eloquent/Traits/RoleTrait.php 1 location
|
@@ 19-26 (lines=8) @@
|
16 |
|
trait RoleTrait |
17 |
|
{ |
18 |
|
|
19 |
|
public function cachedPermissions() |
20 |
|
{ |
21 |
|
$cacheKey = 'entrust_permissions_for_role_' . $this->getKey(); |
22 |
|
return Cache::/*tags(Config::get('entrust.permission_role_table'))->*/ |
23 |
|
remember($cacheKey, Config::get('cache.ttl'), function () { |
24 |
|
return $this->perms()->get(); |
25 |
|
}); |
26 |
|
} |
27 |
|
|
28 |
|
public static function bootEntrustRoleTrait() |
29 |
|
{ |