WebsiteSettings.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. namespace App\Settings;
  3. use Spatie\LaravelSettings\Settings;
  4. class WebsiteSettings extends Settings
  5. {
  6. public bool $show_imprint;
  7. public bool $show_privacy;
  8. public bool $show_tos;
  9. public bool $useful_links_enabled;
  10. public bool $enable_login_logo;
  11. public ?string $seo_title;
  12. public ?string $seo_description;
  13. public bool $motd_enabled;
  14. public ?string $motd_message;
  15. public static function group(): string
  16. {
  17. return 'website';
  18. }
  19. /**
  20. * Summary of validations array
  21. * @return array<string, string>
  22. */
  23. public static function getValidations()
  24. {
  25. return [
  26. 'motd_enabled' => 'nullable|string',
  27. 'motd_message' => 'nullable|string',
  28. 'show_imprint' => 'nullable|string',
  29. 'show_privacy' => 'nullable|string',
  30. 'show_tos' => 'nullable|string',
  31. 'useful_links_enabled' => 'nullable|string',
  32. 'enable_login_logo' => 'nullable|string',
  33. 'seo_title' => 'nullable|string',
  34. 'seo_description' => 'nullable|string',
  35. ];
  36. }
  37. /**
  38. * Summary of optionTypes
  39. * Only used for the settings page
  40. * @return array<array<'type'|'label'|'description'|'options', string|array<string, string>>>
  41. */
  42. public static function getOptionInputData()
  43. {
  44. return [
  45. 'category_icon' => 'fas fa-globe',
  46. 'motd_enabled' => [
  47. 'label' => 'Enable MOTD',
  48. 'type' => 'boolean',
  49. 'description' => 'Enable the MOTD (Message of the day) on the dashboard.',
  50. ],
  51. 'motd_message' => [
  52. 'label' => 'MOTD Message',
  53. 'type' => 'textarea',
  54. 'description' => 'The message of the day.',
  55. ],
  56. 'show_imprint' => [
  57. 'label' => 'Show Imprint',
  58. 'type' => 'boolean',
  59. 'description' => 'Show the imprint on the website.',
  60. ],
  61. 'show_privacy' => [
  62. 'label' => 'Show Privacy',
  63. 'type' => 'boolean',
  64. 'description' => 'Show the privacy on the website.',
  65. ],
  66. 'show_tos' => [
  67. 'label' => 'Show TOS',
  68. 'type' => 'boolean',
  69. 'description' => 'Show the TOS on the website.',
  70. ],
  71. 'useful_links_enabled' => [
  72. 'label' => 'Enable Useful Links',
  73. 'type' => 'boolean',
  74. 'description' => 'Enable the useful links on the dashboard.',
  75. ],
  76. 'seo_title' => [
  77. 'label' => 'SEO Title',
  78. 'type' => 'string',
  79. 'description' => 'The title of the website.',
  80. ],
  81. 'seo_description' => [
  82. 'label' => 'SEO Description',
  83. 'type' => 'string',
  84. 'description' => 'The description of the website.',
  85. ],
  86. 'enable_login_logo' => [
  87. 'label' => 'Enable Login Logo',
  88. 'type' => 'boolean',
  89. 'description' => 'Enable the logo on the login page.',
  90. ],
  91. ];
  92. }
  93. }