*/ class ProductionCalendarDayFactory extends Factory { protected $model = ProductionCalendarDay::class; public function definition(): array { $date = fake()->unique()->dateTimeBetween('-1 year', '+2 years'); return [ 'date' => $date->format('Y-m-d'), 'is_working_day' => ! in_array((int) $date->format('N'), [6, 7], true), 'name' => fake()->optional()->sentence(3), ]; } }