InvoiceSettings.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. namespace App\Settings;
  3. use Spatie\LaravelSettings\Settings;
  4. class InvoiceSettings extends Settings
  5. {
  6. public bool $enabled;
  7. public ?string $company_address;
  8. public ?string $company_mail;
  9. public ?string $company_name;
  10. public ?string $company_phone;
  11. public ?string $company_vat;
  12. public ?string $company_website;
  13. public ?string $prefix;
  14. public static function group(): string
  15. {
  16. return 'invoice';
  17. }
  18. /**
  19. * Summary of validations array
  20. * @return array<string, string>
  21. */
  22. public static function getValidations()
  23. {
  24. return [
  25. 'company_address' => 'nullable|string',
  26. 'company_mail' => 'nullable|string',
  27. 'company_name' => 'nullable|string',
  28. 'company_phone' => 'nullable|string',
  29. 'company_vat' => 'nullable|string',
  30. 'company_website' => 'nullable|string',
  31. 'enabled' => 'nullable|string',
  32. 'prefix' => 'nullable|string',
  33. ];
  34. }
  35. /**
  36. * Summary of optionTypes
  37. * Only used for the settings page
  38. * @return array<array<'type'|'label'|'description'|'options', string|bool|float|int|array<string, string>>>
  39. */
  40. public static function getOptionInputData()
  41. {
  42. return [
  43. 'category_icon' => 'fas fa-file-invoice-dollar',
  44. 'company_address' => [
  45. 'label' => 'Company Address',
  46. 'type' => 'string',
  47. 'description' => 'The address of your company.',
  48. ],
  49. 'company_mail' => [
  50. 'label' => 'Company Mail',
  51. 'type' => 'string',
  52. 'description' => 'The mail of your company.',
  53. ],
  54. 'company_name' => [
  55. 'label' => 'Company Name',
  56. 'type' => 'string',
  57. 'description' => 'The name of your company.',
  58. ],
  59. 'company_phone' => [
  60. 'label' => 'Company Phone',
  61. 'type' => 'string',
  62. 'description' => 'The phone of your company.',
  63. ],
  64. 'company_vat' => [
  65. 'label' => 'Company VAT ID',
  66. 'type' => 'string',
  67. 'description' => 'The VAT ID of your company.',
  68. ],
  69. 'company_website' => [
  70. 'label' => 'Company Website',
  71. 'type' => 'string',
  72. 'description' => 'The website of your company.',
  73. ],
  74. 'enabled' => [
  75. 'label' => 'Enabled',
  76. 'type' => 'boolean',
  77. 'description' => 'Enable or disable invoices.',
  78. ],
  79. 'prefix' => [
  80. 'label' => 'Prefix',
  81. 'type' => 'string',
  82. 'description' => 'The prefix of your invoices.',
  83. ],
  84. ];
  85. }
  86. }