*/ class BookingFactory extends Factory { protected $model = Booking::class; public function definition(): array { $start = fake()->dateTimeBetween('+1 month', '+6 months'); $end = fake()->dateTimeBetween($start, '+12 months'); return [ 'customer_id' => CustomerFactory::new(), 'lead_id' => LeadFactory::new(), 'booking_date' => now()->format('Y-m-d'), 'start_date' => $start->format('Y-m-d'), 'end_date' => $end->format('Y-m-d'), 'sf_guard_user_id' => null, 'branch_id' => null, 'service_fee' => 0.0, 'travel_country_id' => null, 'travel_category_id' => null, 'pax' => 2, 'coupon_id' => null, 'title' => fake()->sentence(4), 'travel_number' => strtoupper(fake()->bothify('??####')), 'participant_name' => fake()->lastName(), 'participant_firstname' => fake()->firstName(), 'participant_birthdate' => fake()->dateTimeBetween('-60 years', '-18 years')->format('Y-m-d'), 'participant_salutation_id' => 1, 'ev_number' => '', 'merlin_knr' => '', 'merlin_order_number' => '', 'travel_company_id' => null, 'travel_documents' => false, 'price' => fake()->randomFloat(2, 500, 5000), 'price_total' => 0.0, 'deposit_total' => 0.0, 'final_payment' => 0.0, 'final_payment_date' => null, 'travelagenda_id' => null, 'website_id' => null, 'new_drafts' => false, ]; } public function canceled(): static { return $this->state(fn (array $attributes) => [ 'canceled' => 1.0, ]); } public function withPrice(float $price): static { return $this->state(fn (array $attributes) => [ 'price' => $price, 'price_total' => $price, ]); } }