CustomerFactory.php 650B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Database\Factories;
  3. use Illuminate\Database\Eloquent\Factories\Factory;
  4. /**
  5. * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Customer>
  6. */
  7. class CustomerFactory extends Factory
  8. {
  9. /**
  10. * Define the model's default state.
  11. *
  12. * @return array<string, mixed>
  13. */
  14. public function definition()
  15. {
  16. return [
  17. 'customer_number' => 'CS' . now()->format('YmdHis'),
  18. 'name' => $this->faker->name(),
  19. 'phone' => $this->faker->phoneNumber(),
  20. 'address' => $this->faker->address,
  21. 'gender_id' => random_int(1, 2),
  22. ];
  23. }
  24. }