<?php

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

use App\HotelReservation;
use Faker\Generator as Faker;

$factory->define(HotelReservation::class, function (Faker $faker) {
    $users = \App\User::where('role', 'user')->pluck('id')->toArray();
    $emails = \App\User::where('role', 'user')->pluck('email')->toArray();
    $phones = \App\User::where('role', 'user')->pluck('phone')->toArray();
    $names = \App\User::where('role', 'user')->pluck('name')->toArray();
    $users[] = null;
    return [
        'status' => $faker->randomElement(['current', 'finished']),
//        'name' => $faker->randomElement($names),
//        'user_id' => $faker->randomElement($users),
//        'email' => $faker->randomElement($emails),
//        'phone' => $faker->randomElement($phones),
        'days_count' => $faker->randomNumber(1),
        'person_count' => $faker->randomNumber(1),
        'going_date' => \Illuminate\Support\Carbon::now()->addDays(2)->format('Y-m-d'),
        'return_date' => \Illuminate\Support\Carbon::now()->addDays(4)->format('Y-m-d'),
    ];
});
