34 lines
928 B
PHP
34 lines
928 B
PHP
<?php
|
||
|
||
namespace Database\Factories;
|
||
|
||
use App\Models\Course;
|
||
use App\Models\CourseSchedule;
|
||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||
|
||
/**
|
||
* @extends Factory<CourseSchedule>
|
||
*/
|
||
class CourseScheduleFactory extends Factory
|
||
{
|
||
/**
|
||
* @return array<string, mixed>
|
||
*/
|
||
public function definition(): array
|
||
{
|
||
$startDate = fake()->dateTimeBetween('+1 week', '+3 months');
|
||
$endDate = (clone $startDate)->modify('+'.fake()->numberBetween(3, 14).' days');
|
||
$quota = fake()->numberBetween(10, 30);
|
||
|
||
return [
|
||
'course_id' => Course::factory(),
|
||
'start_date' => $startDate,
|
||
'end_date' => $endDate,
|
||
'location' => fake()->randomElement(['Kadıköy', 'Tuzla', 'Online']),
|
||
'quota' => $quota,
|
||
'available_seats' => fake()->numberBetween(0, $quota),
|
||
'is_urgent' => fake()->boolean(20),
|
||
];
|
||
}
|
||
}
|