TicketSettings.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace App\Settings;
  3. use Spatie\LaravelSettings\Settings;
  4. class TicketSettings extends Settings
  5. {
  6. public bool $enabled;
  7. public ?string $information;
  8. public static function group(): string
  9. {
  10. return 'ticket';
  11. }
  12. /**
  13. * Summary of validations array
  14. * @return array<string, string>
  15. */
  16. public static function getValidations()
  17. {
  18. return [
  19. 'enabled' => 'nullable|string',
  20. 'information' => 'nullable|string',
  21. ];
  22. }
  23. /**
  24. * Summary of optionTypes
  25. * Only used for the settings page
  26. * @return array<array<'type'|'label'|'description'|'options', string|bool|float|int|array<string, string>>>
  27. */
  28. public static function getOptionInputData()
  29. {
  30. return [
  31. 'category_icon' => 'fas fa-ticket-alt',
  32. 'enabled' => [
  33. 'label' => 'Enabled',
  34. 'type' => 'boolean',
  35. 'description' => 'Enable or disable the ticket system.',
  36. ],
  37. 'information' => [
  38. 'label' => 'Ticket Information',
  39. 'type' => 'textarea',
  40. 'description' => 'Message shown on the right side when users create a new ticket.',
  41. ],
  42. ];
  43. }
  44. }