<?php

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

use App\Section;
use Faker\Generator as Faker;
use App\Semester;
use App\Course;

$factory->define(Section::class, function (Faker $faker) {
    // dd(Semester::all()->pluck('code')->toArray());
    return [
        'semester_code'      => $faker->randomElement(Semester::all()->pluck('code')->toArray()),
        'course_id'     => $faker->numberBetween(1, Course::count()),
        'code'          => $faker->lexify('???'),
        'student_count' => $faker->optional()->randomNumber(3),
        'syllabus'      => $faker->optional()->text(),
        'credits'       => $faker->optional()->randomFloat(2,0,4),
    ];
});
