*/ class SkillFactory extends Factory { /** * @return array */ public function definition(): array { return [ 'title' => fake()->randomElement(['Laravel', 'PHP', 'Docker', 'Tailwind CSS']), 'description' => fake()->sentence(), 'rating' => fake()->numberBetween(1, 10), 'type' => fake()->randomElement(['rating', 'tag', 'other']), ]; } public function rating(): static { return $this->state(fn (array $attributes) => [ 'type' => 'rating', 'rating' => fake()->numberBetween(1, 10), ]); } }