<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\UmrahTrip;
use Faker\Generator as Faker;

$factory->define(UmrahTrip::class, function (Faker $faker) {
    $cities = \App\City::pluck('id')->toArray();
    $images = [
        '/assets/web/images/hall-1.png',
        '/assets/web/images/hall-2.png',
        '/assets/web/images/hall-3.png',
    ];
    return [
//        'umrah_trip_type' => $faker->randomElement(['u', 'ut', 'uta']),
        'house_type' => $faker->randomElement(['private', 'group']),
        'price_per_person' => $faker->randomFloat(0, 100, 500),
        'umrah_trip_date' => [
            \Illuminate\Support\Carbon::now()->addDays(1)->format('Y-m-d'),
            \Illuminate\Support\Carbon::now()->addDays(3)->format('Y-m-d'),
            \Illuminate\Support\Carbon::now()->addDays(7)->format('Y-m-d'),
            \Illuminate\Support\Carbon::now()->addDays(13)->format('Y-m-d'),
            \Illuminate\Support\Carbon::now()->addDays(16)->format('Y-m-d'),
            \Illuminate\Support\Carbon::now()->addDays(21)->format('Y-m-d'),
            \Illuminate\Support\Carbon::now()->addDays(24)->format('Y-m-d'),
            \Illuminate\Support\Carbon::now()->addDays(28)->format('Y-m-d'),
        ],
        'departure_city' => $faker->randomElement($cities),
        'arrival_city' => $faker->randomElement($cities),
        'rally_point_info' => [
            ['address' => $faker->address, 'lng' => $faker->longitude, 'lat' => $faker->latitude],
            ['address' => $faker->address, 'lng' => $faker->longitude, 'lat' => $faker->latitude],
            ['address' => $faker->address, 'lng' => $faker->longitude, 'lat' => $faker->latitude],
        ],
        'image' => $faker->randomElement($images),
    ];
});
