You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

186 lines
6.4 KiB

1 month ago
  1. <?php
  2. return [
  3. 'models' => [
  4. /*
  5. * When using the "HasPermissions" trait from this package, we need to know which
  6. * Eloquent model should be used to retrieve your permissions. Of course, it
  7. * is often just the "Permission" model but you may use whatever you like.
  8. *
  9. * The model you want to use as a Permission model needs to implement the
  10. * `Spatie\Permission\Contracts\Permission` contract.
  11. */
  12. 'permission' => Spatie\Permission\Models\Permission::class,
  13. /*
  14. * When using the "HasRoles" trait from this package, we need to know which
  15. * Eloquent model should be used to retrieve your roles. Of course, it
  16. * is often just the "Role" model but you may use whatever you like.
  17. *
  18. * The model you want to use as a Role model needs to implement the
  19. * `Spatie\Permission\Contracts\Role` contract.
  20. */
  21. 'role' => Spatie\Permission\Models\Role::class,
  22. ],
  23. 'table_names' => [
  24. /*
  25. * When using the "HasRoles" trait from this package, we need to know which
  26. * table should be used to retrieve your roles. We have chosen a basic
  27. * default value but you may easily change it to any table you like.
  28. */
  29. 'roles' => 'roles',
  30. /*
  31. * When using the "HasPermissions" trait from this package, we need to know which
  32. * table should be used to retrieve your permissions. We have chosen a basic
  33. * default value but you may easily change it to any table you like.
  34. */
  35. 'permissions' => 'permissions',
  36. /*
  37. * When using the "HasPermissions" trait from this package, we need to know which
  38. * table should be used to retrieve your models permissions. We have chosen a
  39. * basic default value but you may easily change it to any table you like.
  40. */
  41. 'model_has_permissions' => 'model_has_permissions',
  42. /*
  43. * When using the "HasRoles" trait from this package, we need to know which
  44. * table should be used to retrieve your models roles. We have chosen a
  45. * basic default value but you may easily change it to any table you like.
  46. */
  47. 'model_has_roles' => 'model_has_roles',
  48. /*
  49. * When using the "HasRoles" trait from this package, we need to know which
  50. * table should be used to retrieve your roles permissions. We have chosen a
  51. * basic default value but you may easily change it to any table you like.
  52. */
  53. 'role_has_permissions' => 'role_has_permissions',
  54. ],
  55. 'column_names' => [
  56. /*
  57. * Change this if you want to name the related pivots other than defaults
  58. */
  59. 'role_pivot_key' => null, //default 'role_id',
  60. 'permission_pivot_key' => null, //default 'permission_id',
  61. /*
  62. * Change this if you want to name the related model primary key other than
  63. * `model_id`.
  64. *
  65. * For example, this would be nice if your primary keys are all UUIDs. In
  66. * that case, name this `model_uuid`.
  67. */
  68. 'model_morph_key' => 'model_id',
  69. /*
  70. * Change this if you want to use the teams feature and your related model's
  71. * foreign key is other than `team_id`.
  72. */
  73. 'team_foreign_key' => 'team_id',
  74. ],
  75. /*
  76. * When set to true, the method for checking permissions will be registered on the gate.
  77. * Set this to false if you want to implement custom logic for checking permissions.
  78. */
  79. 'register_permission_check_method' => true,
  80. /*
  81. * When set to true, the Spatie\Permission\Listeners\OctaneReloadPermissions listener will be registered
  82. * on the Laravel\Octane\Events\OperationTerminated event, this will refresh permissions on every
  83. * TickTerminated, TaskTerminated and RequestTerminated
  84. * NOTE: This should not be needed in most cases, but an Octane/Vapor combination benefited from it.
  85. */
  86. 'register_octane_reset_listener' => false,
  87. /*
  88. * Teams Feature.
  89. * When set to true the package implements teams using the 'team_foreign_key'.
  90. * If you want the migrations to register the 'team_foreign_key', you must
  91. * set this to true before doing the migration.
  92. * If you already did the migration then you must make a new migration to also
  93. * add 'team_foreign_key' to 'roles', 'model_has_roles', and 'model_has_permissions'
  94. * (view the latest version of this package's migration file)
  95. */
  96. 'teams' => false,
  97. /*
  98. * Passport Client Credentials Grant
  99. * When set to true the package will use Passports Client to check permissions
  100. */
  101. 'use_passport_client_credentials' => false,
  102. /*
  103. * When set to true, the required permission names are added to exception messages.
  104. * This could be considered an information leak in some contexts, so the default
  105. * setting is false here for optimum safety.
  106. */
  107. 'display_permission_in_exception' => false,
  108. /*
  109. * When set to true, the required role names are added to exception messages.
  110. * This could be considered an information leak in some contexts, so the default
  111. * setting is false here for optimum safety.
  112. */
  113. 'display_role_in_exception' => false,
  114. /*
  115. * By default wildcard permission lookups are disabled.
  116. * See documentation to understand supported syntax.
  117. */
  118. 'enable_wildcard_permission' => false,
  119. /*
  120. * The class to use for interpreting wildcard permissions.
  121. * If you need to modify delimiters, override the class and specify its name here.
  122. */
  123. // 'permission.wildcard_permission' => Spatie\Permission\WildcardPermission::class,
  124. /* Cache-specific settings */
  125. 'cache' => [
  126. /*
  127. * By default all permissions are cached for 24 hours to speed up performance.
  128. * When permissions or roles are updated the cache is flushed automatically.
  129. */
  130. 'expiration_time' => \DateInterval::createFromDateString('24 hours'),
  131. /*
  132. * The cache key used to store all permissions.
  133. */
  134. 'key' => 'spatie.permission.cache',
  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. 'store' => 'default',
  141. ],
  142. ];