Update config/permission.php

This commit is contained in:
DariusIII
2018-11-19 23:00:20 +01:00
parent ad9f1b45aa
commit 12c2b55a39
2 changed files with 38 additions and 5 deletions
+37 -5
View File
@@ -71,12 +71,17 @@ return [
'role_has_permissions' => 'role_has_permissions',
],
/*
* By default all permissions will be cached for 24 hours unless a permission or
* role is updated. Then the cache will be flushed immediately.
*/
'column_names' => [
'cache_expiration_time' => 60 * 24,
/*
* Change this if you want to name the related model primary key other than
* `model_id`.
*
* For example, this would be nice if your primary keys are all UUIDs. In
* that case, name this `model_uuid`.
*/
'model_morph_key' => 'model_id',
],
/*
* When set to true, the required permission/role names are added to the exception
@@ -85,4 +90,31 @@ return [
*/
'display_permission_in_exception' => false,
'cache' => [
/*
* By default all permissions will be cached for 24 hours unless a permission or
* role is updated. Then the cache will be flushed immediately.
*/
'expiration_time' => 60 * 24,
/*
* The key to use when tagging and prefixing entries in the cache.
*/
'key' => 'spatie.permission.cache',
/*
* When checking for a permission against a model by passing a Permission
* instance to the check, this key determines what attribute on the
* Permissions model is used to cache against.
*
* Ideally, this should match your preferred way of checking permissions, eg:
* `$user->can('view-posts')` would be 'name'.
*/
'model_key' => 'name',
],
];