|
| 1 | +<?php |
| 2 | + |
| 3 | +return [ |
| 4 | + |
| 5 | + 'models' => [ |
| 6 | + |
| 7 | + /* |
| 8 | + * When using the "HasPermissions" trait from this package, we need to know which |
| 9 | + * Eloquent model should be used to retrieve your permissions. Of course, it |
| 10 | + * is often just the "Permission" model but you may use whatever you like. |
| 11 | + * |
| 12 | + * The model you want to use as a Permission model needs to implement the |
| 13 | + * `Spatie\Permission\Contracts\Permission` contract. |
| 14 | + */ |
| 15 | + |
| 16 | + 'permission' => Spatie\Permission\Models\Permission::class, |
| 17 | + |
| 18 | + /* |
| 19 | + * When using the "HasRoles" trait from this package, we need to know which |
| 20 | + * Eloquent model should be used to retrieve your roles. Of course, it |
| 21 | + * is often just the "Role" model but you may use whatever you like. |
| 22 | + * |
| 23 | + * The model you want to use as a Role model needs to implement the |
| 24 | + * `Spatie\Permission\Contracts\Role` contract. |
| 25 | + */ |
| 26 | + |
| 27 | + 'role' => Spatie\Permission\Models\Role::class, |
| 28 | + |
| 29 | + ], |
| 30 | + |
| 31 | + 'table_names' => [ |
| 32 | + |
| 33 | + /* |
| 34 | + * When using the "HasRoles" trait from this package, we need to know which |
| 35 | + * table should be used to retrieve your roles. We have chosen a basic |
| 36 | + * default value but you may easily change it to any table you like. |
| 37 | + */ |
| 38 | + |
| 39 | + 'roles' => 'roles', |
| 40 | + |
| 41 | + /* |
| 42 | + * When using the "HasPermissions" trait from this package, we need to know which |
| 43 | + * table should be used to retrieve your permissions. We have chosen a basic |
| 44 | + * default value but you may easily change it to any table you like. |
| 45 | + */ |
| 46 | + |
| 47 | + 'permissions' => 'permissions', |
| 48 | + |
| 49 | + /* |
| 50 | + * When using the "HasPermissions" trait from this package, we need to know which |
| 51 | + * table should be used to retrieve your models permissions. We have chosen a |
| 52 | + * basic default value but you may easily change it to any table you like. |
| 53 | + */ |
| 54 | + |
| 55 | + 'model_has_permissions' => 'model_has_permissions', |
| 56 | + |
| 57 | + /* |
| 58 | + * When using the "HasRoles" trait from this package, we need to know which |
| 59 | + * table should be used to retrieve your models roles. We have chosen a |
| 60 | + * basic default value but you may easily change it to any table you like. |
| 61 | + */ |
| 62 | + |
| 63 | + 'model_has_roles' => 'model_has_roles', |
| 64 | + |
| 65 | + /* |
| 66 | + * When using the "HasRoles" trait from this package, we need to know which |
| 67 | + * table should be used to retrieve your roles permissions. We have chosen a |
| 68 | + * basic default value but you may easily change it to any table you like. |
| 69 | + */ |
| 70 | + |
| 71 | + 'role_has_permissions' => 'role_has_permissions', |
| 72 | + ], |
| 73 | + |
| 74 | + 'column_names' => [ |
| 75 | + |
| 76 | + /* |
| 77 | + * Change this if you want to name the related model primary key other than |
| 78 | + * `model_id`. |
| 79 | + * |
| 80 | + * For example, this would be nice if your primary keys are all UUIDs. In |
| 81 | + * that case, name this `model_uuid`. |
| 82 | + */ |
| 83 | + |
| 84 | + 'model_morph_key' => 'model_id', |
| 85 | + ], |
| 86 | + |
| 87 | + /* |
| 88 | + * When set to true, the required permission names are added to the exception |
| 89 | + * message. This could be considered an information leak in some contexts, so |
| 90 | + * the default setting is false here for optimum safety. |
| 91 | + */ |
| 92 | + |
| 93 | + 'display_permission_in_exception' => false, |
| 94 | + |
| 95 | + /* |
| 96 | + * When set to true, the required role names are added to the exception |
| 97 | + * message. This could be considered an information leak in some contexts, so |
| 98 | + * the default setting is false here for optimum safety. |
| 99 | + */ |
| 100 | + |
| 101 | + 'display_role_in_exception' => false, |
| 102 | + |
| 103 | + /* |
| 104 | + * By default wildcard permission lookups are disabled. |
| 105 | + */ |
| 106 | + |
| 107 | + 'enable_wildcard_permission' => false, |
| 108 | + |
| 109 | + 'cache' => [ |
| 110 | + |
| 111 | + /* |
| 112 | + * By default all permissions are cached for 24 hours to speed up performance. |
| 113 | + * When permissions or roles are updated the cache is flushed automatically. |
| 114 | + */ |
| 115 | + |
| 116 | + 'expiration_time' => \DateInterval::createFromDateString('24 hours'), |
| 117 | + |
| 118 | + /* |
| 119 | + * The cache key used to store all permissions. |
| 120 | + */ |
| 121 | + |
| 122 | + 'key' => 'spatie.permission.cache', |
| 123 | + |
| 124 | + /* |
| 125 | + * When checking for a permission against a model by passing a Permission |
| 126 | + * instance to the check, this key determines what attribute on the |
| 127 | + * Permissions model is used to cache against. |
| 128 | + * |
| 129 | + * Ideally, this should match your preferred way of checking permissions, eg: |
| 130 | + * `$user->can('view-posts')` would be 'name'. |
| 131 | + */ |
| 132 | + |
| 133 | + 'model_key' => 'name', |
| 134 | + |
| 135 | + /* |
| 136 | + * You may optionally indicate a specific cache driver to use for permission and |
| 137 | + * role caching using any of the `store` drivers listed in the cache.php config |
| 138 | + * file. Using 'default' here means to use the `default` set in cache.php. |
| 139 | + */ |
| 140 | + |
| 141 | + 'store' => 'default', |
| 142 | + ], |
| 143 | +]; |
0 commit comments