/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $subjects = array(['name' => 'English'], ['name' => 'Mathamatics'], ['name' => 'Arabic'], ['name' => 'Urdu'], ['name' => 'Malayalam'], ['name' => 'Hindi'], ['name' => 'Physics'], ['name' => 'Biology'], ['name' => 'Chemistry'], ['name' => 'Science'], ['name' => 'Social Science'], ['name' => 'None'], ['name' => 'Other']);
     foreach ($subjects as $index => $subject) {
         App\Models\Subject::create($subject);
     }
 }
    $user->user_type_id = 3;
    $user->username = '******' . (App\Models\User::count() + 1);
    $user->save();
    return ['occupation' => $faker->word, 'user_id' => $user->id];
});
$factory->define(App\Models\Foundation::class, function ($faker) {
    $user = factory('App\\Models\\User')->make();
    $user->user_type_id = 4;
    $user->username = '******' . (App\Models\User::count() + 1);
    $user->save();
    return ['designation' => $faker->word, 'user_id' => $user->id];
});
$factory->define(App\Models\StudentTimetable::class, function ($faker) {
    $subjects = App\Models\Subject::all();
    $courseSchool = App\Models\CourseSchool::all()->random();
    return ['period' => $faker->numberBetween(1, 7), 'mon' => $subjects->random()->id, 'tue' => $subjects->random()->id, 'wed' => $subjects->random()->id, 'thu' => $subjects->random()->id, 'fri' => $subjects->random()->id, 'sat' => $subjects->random()->id, 'course_school_id' => $courseSchool->id];
});
$factory->define(App\Models\StaffTimetable::class, function ($faker) {
    $course = App\Models\Course::all();
    $staff = App\Models\User::where('user_type_id', 2)->get()->random();
    return ['period' => $faker->numberBetween(1, 7), 'mon' => $course->random()->id, 'tue' => $course->random()->id, 'wed' => $course->random()->id, 'thu' => $course->random()->id, 'fri' => $course->random()->id, 'sat' => $course->random()->id, 'staff_id' => $staff->id];
});
$factory->define(App\Models\Book::class, function ($faker) {
    return ['title' => $faker->sentence(3), 'subject_id' => App\Models\Subject::all()->random()->id, 'description' => $faker->sentence, 'author' => $faker->name, 'publisher' => $faker->sentence(3), 'uploaded_by' => App\Models\Staff::all()->random()->user_id, 'image' => $faker->imageUrl(300, 100, 'transport', true, 'Faker'), 'book_url' => $faker->imageUrl(300, 300, 'people', true, 'Faker') . ".pdf"];
});
$factory->define(App\Models\News::class, function ($faker) {
    return ['title' => $faker->sentence(3), 'level' => ['PUBLIC', 'STUDENT', 'FOUNDATION', 'STAFF', 'PARENT', 'SCHOOL', 'CLASS'][array_rand(['PUBLIC', 'STUDENT', 'FOUNDATION', 'STAFF', 'PARENT', 'SCHOOL', 'CLASS'])], 'image' => $faker->imageUrl(300, 100, null, true, 'Faker'), 'content' => $faker->paragraph, 'creator_id' => App\Models\User::where('user_type_id', 4)->orWhere('user_type_id', 5)->get()->random()->id];
});
$factory->define(App\Models\Talent::class, function ($faker) {
    return ['image' => $faker->imageUrl(300, 100, 'abstract', true, 'Faker'), 'content' => $faker->paragraph, 'posted_by' => App\Models\User::all()->random()->id];
});