insert([ 'subject_id' => 1, 'date' => '2019-12-02', 'code' => generateRandomString(10) ]); DB::table('classes')->insert([ 'subject_id' => 2, 'date' => '2019-12-02', 'code' => generateRandomString(10) ]); } }