settings.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. use App\Helpers\ExtensionHelper;
  3. use App\Settings\GeneralSettings;
  4. use App\Settings\DiscordSettings;
  5. use App\Settings\InvoiceSettings;
  6. use App\Settings\LocaleSettings;
  7. use App\Settings\MailSettings;
  8. use App\Settings\PterodactylSettings;
  9. use App\Settings\ReferralSettings;
  10. use App\Settings\ServerSettings;
  11. use App\Settings\UserSettings;
  12. use App\Settings\WebsiteSettings;
  13. use App\Settings\TicketSettings;
  14. use App\Settings\CouponSettings;
  15. return [
  16. /*
  17. * Each settings class used in your application must be registered, you can
  18. * put them (manually) here.
  19. */
  20. 'settings' => [
  21. GeneralSettings::class,
  22. DiscordSettings::class,
  23. InvoiceSettings::class,
  24. LocaleSettings::class,
  25. MailSettings::class,
  26. PterodactylSettings::class,
  27. ReferralSettings::class,
  28. ServerSettings::class,
  29. UserSettings::class,
  30. WebsiteSettings::class,
  31. TicketSettings::class,
  32. CouponSettings::class,
  33. ],
  34. /*
  35. * The path where the settings classes will be created.
  36. */
  37. 'setting_class_path' => app_path('Settings'),
  38. /*
  39. * In these directories settings migrations will be stored and ran when migrating. A settings
  40. * migration created via the make:settings-migration command will be stored in the first path or
  41. * a custom defined path when running the command.
  42. */
  43. 'migrations_paths' => [
  44. database_path('settings'),
  45. ...ExtensionHelper::getAllExtensionMigrations()
  46. ],
  47. /*
  48. * When no repository was set for a settings class the following repository
  49. * will be used for loading and saving settings.
  50. */
  51. 'default_repository' => 'database',
  52. /*
  53. * Settings will be stored and loaded from these repositories.
  54. */
  55. 'repositories' => [
  56. 'database' => [
  57. 'type' => Spatie\LaravelSettings\SettingsRepositories\DatabaseSettingsRepository::class,
  58. 'model' => null,
  59. 'table' => null,
  60. 'connection' => null,
  61. ],
  62. 'redis' => [
  63. 'type' => Spatie\LaravelSettings\SettingsRepositories\RedisSettingsRepository::class,
  64. 'connection' => null,
  65. 'prefix' => null,
  66. ],
  67. ],
  68. /*
  69. * The contents of settings classes can be cached through your application,
  70. * settings will be stored within a provided Laravel store and can have an
  71. * additional prefix.
  72. */
  73. 'cache' => [
  74. 'enabled' => env('SETTINGS_CACHE_ENABLED', true),
  75. 'store' => 'redis',
  76. 'prefix' => 'setting',
  77. 'ttl' => null,
  78. ],
  79. /*
  80. * These global casts will be automatically used whenever a property within
  81. * your settings class isn't a default PHP type.
  82. */
  83. 'global_casts' => [
  84. DateTimeInterface::class => Spatie\LaravelSettings\SettingsCasts\DateTimeInterfaceCast::class,
  85. DateTimeZone::class => Spatie\LaravelSettings\SettingsCasts\DateTimeZoneCast::class,
  86. // Spatie\DataTransferObject\DataTransferObject::class => Spatie\LaravelSettings\SettingsCasts\DtoCast::class,
  87. Spatie\LaravelData\Data::class => Spatie\LaravelSettings\SettingsCasts\DataCast::class,
  88. ],
  89. /*
  90. * The package will look for settings in these paths and automatically
  91. * register them.
  92. */
  93. 'auto_discover_settings' => [
  94. app()->path(),
  95. ],
  96. /*
  97. * Automatically discovered settings classes can be cached so they don't
  98. * need to be searched each time the application boots up.
  99. */
  100. 'discovered_settings_cache_path' => storage_path('app/laravel-settings'),
  101. ];