|
| 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 | + * Change this if you want to name the related pivots other than defaults |
| 77 | + */ |
| 78 | + 'role_pivot_key' => null, //default 'role_id', |
| 79 | + 'permission_pivot_key' => null, //default 'permission_id', |
| 80 | + |
| 81 | + /* |
| 82 | + * Change this if you want to name the related model primary key other than |
| 83 | + * `model_id`. |
| 84 | + * |
| 85 | + * For example, this would be nice if your primary keys are all UUIDs. In |
| 86 | + * that case, name this `model_uuid`. |
| 87 | + */ |
| 88 | + |
| 89 | + 'model_morph_key' => 'model_id', |
| 90 | + |
| 91 | + /* |
| 92 | + * Change this if you want to use the teams feature and your related model's |
| 93 | + * foreign key is other than `team_id`. |
| 94 | + */ |
| 95 | + |
| 96 | + 'team_foreign_key' => 'team_id', |
| 97 | + ], |
| 98 | + |
| 99 | + /* |
| 100 | + * When set to true, the method for checking permissions will be registered on the gate. |
| 101 | + * Set this to false if you want to implement custom logic for checking permissions. |
| 102 | + */ |
| 103 | + |
| 104 | + 'register_permission_check_method' => true, |
| 105 | + |
| 106 | + /* |
| 107 | + * When set to true, Laravel\Octane\Events\OperationTerminated event listener will be registered |
| 108 | + * this will refresh permissions on every TickTerminated, TaskTerminated and RequestTerminated |
| 109 | + * NOTE: This should not be needed in most cases, but an Octane/Vapor combination benefited from it. |
| 110 | + */ |
| 111 | + 'register_octane_reset_listener' => false, |
| 112 | + |
| 113 | + /* |
| 114 | + * Teams Feature. |
| 115 | + * When set to true the package implements teams using the 'team_foreign_key'. |
| 116 | + * If you want the migrations to register the 'team_foreign_key', you must |
| 117 | + * set this to true before doing the migration. |
| 118 | + * If you already did the migration then you must make a new migration to also |
| 119 | + * add 'team_foreign_key' to 'roles', 'model_has_roles', and 'model_has_permissions' |
| 120 | + * (view the latest version of this package's migration file) |
| 121 | + */ |
| 122 | + |
| 123 | + 'teams' => false, |
| 124 | + |
| 125 | + /* |
| 126 | + * Passport Client Credentials Grant |
| 127 | + * When set to true the package will use Passports Client to check permissions |
| 128 | + */ |
| 129 | + |
| 130 | + 'use_passport_client_credentials' => false, |
| 131 | + |
| 132 | + /* |
| 133 | + * When set to true, the required permission names are added to exception messages. |
| 134 | + * This could be considered an information leak in some contexts, so the default |
| 135 | + * setting is false here for optimum safety. |
| 136 | + */ |
| 137 | + |
| 138 | + 'display_permission_in_exception' => false, |
| 139 | + |
| 140 | + /* |
| 141 | + * When set to true, the required role names are added to exception messages. |
| 142 | + * This could be considered an information leak in some contexts, so the default |
| 143 | + * setting is false here for optimum safety. |
| 144 | + */ |
| 145 | + |
| 146 | + 'display_role_in_exception' => false, |
| 147 | + |
| 148 | + /* |
| 149 | + * By default wildcard permission lookups are disabled. |
| 150 | + * See documentation to understand supported syntax. |
| 151 | + */ |
| 152 | + |
| 153 | + 'enable_wildcard_permission' => false, |
| 154 | + |
| 155 | + /* |
| 156 | + * The class to use for interpreting wildcard permissions. |
| 157 | + * If you need to modify delimiters, override the class and specify its name here. |
| 158 | + */ |
| 159 | + // 'permission.wildcard_permission' => Spatie\Permission\WildcardPermission::class, |
| 160 | + |
| 161 | + /* Cache-specific settings */ |
| 162 | + |
| 163 | + 'cache' => [ |
| 164 | + |
| 165 | + /* |
| 166 | + * By default all permissions are cached for 24 hours to speed up performance. |
| 167 | + * When permissions or roles are updated the cache is flushed automatically. |
| 168 | + */ |
| 169 | + |
| 170 | + 'expiration_time' => \DateInterval::createFromDateString('24 hours'), |
| 171 | + |
| 172 | + /* |
| 173 | + * The cache key used to store all permissions. |
| 174 | + */ |
| 175 | + |
| 176 | + 'key' => 'spatie.permission.cache', |
| 177 | + |
| 178 | + /* |
| 179 | + * You may optionally indicate a specific cache driver to use for permission and |
| 180 | + * role caching using any of the `store` drivers listed in the cache.php config |
| 181 | + * file. Using 'default' here means to use the `default` set in cache.php. |
| 182 | + */ |
| 183 | + |
| 184 | + 'store' => 'default', |
| 185 | + ], |
| 186 | +]; |
0 commit comments