CategoryFactory.php 597 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Database\Factories;
  3. use Illuminate\Database\Eloquent\Factories\Factory;
  4. /**
  5. * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Category>
  6. */
  7. class CategoryFactory extends Factory
  8. {
  9. /**
  10. * Define the model's default state.
  11. *
  12. * @return array<string, mixed>
  13. */
  14. public function definition(): array
  15. {
  16. $name = $this->faker->word();
  17. return [
  18. 'name' => ucfirst($name),
  19. 'description' => $this->faker->sentence(),
  20. 'is_active' => $this->faker->boolean(80),
  21. ];
  22. }
  23. }