<?php

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

use App\TrainingSession;
use App\TrainingType;
use App\TrainingWorkout;
use Faker\Generator as Faker;

$factory->define(TrainingSession::class, function (Faker $faker) {
    return [
        "day" => $faker->dateTimeBetween('-75 days', '+15 days'),
        "start_time" => $faker->time(),
        "end_time" => $faker->time(),
        "capacity"  => $faker->numberBetween(2,30),
        "training_type_id"      => TrainingType::where("slug", ($faker->boolean ? 'wod' : 'open'))->first()->id,
        "training_workout_id"   => TrainingWorkout::all()->random()->id
    ];
});
