*/ class CourseFactory extends Factory { /** * @return array */ public function definition(): array { $title = fake()->unique()->words(3, true); return [ 'category_id' => Category::factory(), 'slug' => Str::slug($title), 'title' => ucfirst($title), 'sub' => fake()->optional()->word(), 'desc' => fake()->paragraph(), 'long_desc' => fake()->paragraphs(3, true), 'duration' => fake()->randomElement(['3 Gün', '5 Gün', '10 Gün', '2 Hafta']), 'students' => fake()->numberBetween(0, 500), 'rating' => fake()->randomFloat(1, 3.0, 5.0), 'badge' => fake()->optional()->randomElement(['Simülatör', 'Online', 'Yüz Yüze']), 'image' => null, 'price' => fake()->optional()->randomElement(['2.500 TL', '5.000 TL', '7.500 TL', '10.000 TL']), 'includes' => fake()->words(4), 'requirements' => fake()->words(3), 'meta_title' => fake()->sentence(4), 'meta_description' => fake()->sentence(10), 'scope' => fake()->words(5), 'standard' => fake()->optional()->randomElement(['STCW Uyumlu', 'IMO Uyumlu', 'STCW / IMO Uyumlu']), 'language' => 'Türkçe', 'location' => fake()->optional()->randomElement(['Kadıköy, İstanbul', 'Tuzla, İstanbul', 'Beşiktaş, İstanbul']), ]; } }