Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

TaxFactory.php 719B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Database\Factories;
  3. use App\Models\Setting\Tax;
  4. use Illuminate\Database\Eloquent\Factories\Factory;
  5. /**
  6. * @extends Factory<Tax>
  7. */
  8. class TaxFactory extends Factory
  9. {
  10. /**
  11. * The name of the factory's corresponding model.
  12. *
  13. * @var string
  14. */
  15. protected $model = Tax::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. 'rate' => $this->faker->randomFloat(4, 0, 20),
  25. 'computation' => $this->faker->randomElement(Tax::getComputationTypes()),
  26. 'scope' => $this->faker->randomElement(Tax::getTaxScopes()),
  27. ];
  28. }
  29. }