您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

DocumentDefaultFactory.php 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. namespace Database\Factories\Setting;
  3. use App\Models\Setting\DocumentDefault;
  4. use Illuminate\Database\Eloquent\Factories\Factory;
  5. /**
  6. * @extends Factory<DocumentDefault>
  7. */
  8. class DocumentDefaultFactory extends Factory
  9. {
  10. /**
  11. * The name of the factory's corresponding model.
  12. *
  13. * @var string
  14. */
  15. protected $model = DocumentDefault::class;
  16. /**
  17. * Define the model's default state.
  18. *
  19. * @return array<string, mixed>
  20. */
  21. public function definition(): array
  22. {
  23. return [
  24. //
  25. ];
  26. }
  27. /**
  28. * Indicate that the model's type is invoice.
  29. *
  30. * @return DocumentDefaultFactory
  31. */
  32. public function invoice(): self
  33. {
  34. return $this->state([
  35. 'type' => 'invoice',
  36. 'number_prefix' => 'INV-',
  37. 'header' => 'Invoice',
  38. 'item_name' => [
  39. 'option' => 'items',
  40. 'custom' => null,
  41. ],
  42. 'unit_name' => [
  43. 'option' => 'quantity',
  44. 'custom' => null,
  45. ],
  46. 'price_name' => [
  47. 'option' => 'price',
  48. 'custom' => null,
  49. ],
  50. 'amount_name' => [
  51. 'option' => 'amount',
  52. 'custom' => null,
  53. ],
  54. ]);
  55. }
  56. /**
  57. * Indicate that the model's type is bill.
  58. *
  59. * @return DocumentDefaultFactory
  60. */
  61. public function bill(): self
  62. {
  63. return $this->state([
  64. 'type' => 'bill',
  65. 'number_prefix' => 'BILL-',
  66. 'header' => 'Bill',
  67. 'item_name' => [
  68. 'option' => 'items',
  69. 'custom' => null,
  70. ],
  71. 'unit_name' => [
  72. 'option' => 'quantity',
  73. 'custom' => null,
  74. ],
  75. 'price_name' => [
  76. 'option' => 'price',
  77. 'custom' => null,
  78. ],
  79. 'amount_name' => [
  80. 'option' => 'amount',
  81. 'custom' => null,
  82. ],
  83. ]);
  84. }
  85. }