*/ class ScheduledUserDishFactory extends Factory { public function definition(): array { return [ 'schedule_id' => null, 'user_id' => null, 'user_dish_id' => null, 'is_skipped' => false, ]; } public function schedule(Schedule $schedule): self { return $this->state(fn (array $attributes) => [ 'schedule_id' => $schedule->id, ]); } public function user(User $user): self { return $this->state(fn (array $attributes) => [ 'user_id' => $user->id, ]); } public function userDish(UserDish $userDish): self { return $this->state(fn (array $attributes) => [ 'user_dish_id' => $userDish->id, 'user_id' => $userDish->user_id, ]); } public function skipped(): self { return $this->state(fn (array $attributes) => [ 'is_skipped' => true, ]); } }