*/ class CategoryFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { $name = fake()->unique()->words(2, true); return [ 'name' => Str::title($name), 'slug' => Str::slug($name), 'description' => fake()->sentence(), 'color' => fake()->hexColor(), ]; } }