*/ class AttractionFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { $categories = ['museum', 'restaurant', 'historic', 'park', 'cultural', 'entertainment', 'other']; return [ 'city_id' => \App\Models\City::factory(), 'name' => fake()->company() . ' ' . fake()->randomElement(['Museum', 'Restaurant', 'Park', 'Theater', 'Gallery']), 'description' => fake()->paragraph(), 'latitude' => fake()->latitude(), 'longitude' => fake()->longitude(), 'category' => fake()->randomElement($categories), 'source' => fake()->randomElement(['opentripmap', 'overpass', 'wikipedia']), 'source_id' => (string) fake()->randomNumber(8), 'rating' => fake()->optional(0.7)->randomFloat(2, 1, 5), 'image_url' => fake()->optional(0.5)->imageUrl(), 'cached_at' => now(), ]; } }