audit.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <?php
  2. return [
  3. 'enabled' => env('AUDITING_ENABLED', true),
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Audit Implementation
  7. |--------------------------------------------------------------------------
  8. |
  9. | Define which Audit model implementation should be used.
  10. |
  11. */
  12. 'implementation' => OwenIt\Auditing\Models\Audit::class,
  13. /*
  14. |--------------------------------------------------------------------------
  15. | User Morph prefix & Guards
  16. |--------------------------------------------------------------------------
  17. |
  18. | Define the morph prefix and authentication guards for the User resolver.
  19. |
  20. */
  21. 'user' => [
  22. 'morph_prefix' => 'user',
  23. 'guards' => [
  24. 'web',
  25. 'api'
  26. ],
  27. 'resolver' => OwenIt\Auditing\Resolvers\UserResolver::class
  28. ],
  29. /*
  30. |--------------------------------------------------------------------------
  31. | Audit Resolvers
  32. |--------------------------------------------------------------------------
  33. |
  34. | Define the IP Address, User Agent and URL resolver implementations.
  35. |
  36. */
  37. 'resolvers' => [
  38. 'ip_address' => OwenIt\Auditing\Resolvers\IpAddressResolver::class,
  39. 'user_agent' => OwenIt\Auditing\Resolvers\UserAgentResolver::class,
  40. 'url' => OwenIt\Auditing\Resolvers\UrlResolver::class,
  41. ],
  42. /*
  43. |--------------------------------------------------------------------------
  44. | Audit Events
  45. |--------------------------------------------------------------------------
  46. |
  47. | The Eloquent events that trigger an Audit.
  48. |
  49. */
  50. 'events' => [
  51. 'created',
  52. 'updated',
  53. 'deleted',
  54. 'restored'
  55. ],
  56. /*
  57. |--------------------------------------------------------------------------
  58. | Strict Mode
  59. |--------------------------------------------------------------------------
  60. |
  61. | Enable the strict mode when auditing?
  62. |
  63. */
  64. 'strict' => false,
  65. /*
  66. |--------------------------------------------------------------------------
  67. | Global exclude
  68. |--------------------------------------------------------------------------
  69. |
  70. | Have something you always want to exclude by default? - add it here.
  71. | Note that this is overwritten (not merged) with local exclude
  72. |
  73. */
  74. 'exclude' => [],
  75. /*
  76. |--------------------------------------------------------------------------
  77. | Empty Values
  78. |--------------------------------------------------------------------------
  79. |
  80. | Should Audit records be stored when the recorded old_values & new_values
  81. | are both empty?
  82. |
  83. | Some events may be empty on purpose. Use allowed_empty_values to exclude
  84. | those from the empty values check. For example when auditing
  85. | model retrieved events which will never have new and old values.
  86. |
  87. |
  88. */
  89. 'empty_values' => true,
  90. 'allowed_empty_values' => [
  91. 'retrieved'
  92. ],
  93. /*
  94. |--------------------------------------------------------------------------
  95. | Audit Timestamps
  96. |--------------------------------------------------------------------------
  97. |
  98. | Should the created_at, updated_at and deleted_at timestamps be audited?
  99. |
  100. */
  101. 'timestamps' => false,
  102. /*
  103. |--------------------------------------------------------------------------
  104. | Audit Threshold
  105. |--------------------------------------------------------------------------
  106. |
  107. | Specify a threshold for the amount of Audit records a model can have.
  108. | Zero means no limit.
  109. |
  110. */
  111. 'threshold' => 0,
  112. /*
  113. |--------------------------------------------------------------------------
  114. | Audit Driver
  115. |--------------------------------------------------------------------------
  116. |
  117. | The default audit driver used to keep track of changes.
  118. |
  119. */
  120. 'driver' => 'database',
  121. /*
  122. |--------------------------------------------------------------------------
  123. | Audit Driver Configurations
  124. |--------------------------------------------------------------------------
  125. |
  126. | Available audit drivers and respective configurations.
  127. |
  128. */
  129. 'drivers' => [
  130. 'database' => [
  131. 'table' => 'audits',
  132. 'connection' => null,
  133. ],
  134. ],
  135. /*
  136. |--------------------------------------------------------------------------
  137. | Audit Console
  138. |--------------------------------------------------------------------------
  139. |
  140. | Whether console events should be audited (eg. php artisan db:seed).
  141. |
  142. */
  143. 'console' => false,
  144. ];