/** * Run the database seeds. * * @return void */ public function run() { DayOfWeek::firstOrCreate(['name' => 'Sunday']); DayOfWeek::firstOrCreate(['name' => 'Monday']); DayOfWeek::firstOrCreate(['name' => 'Tuesday']); DayOfWeek::firstOrCreate(['name' => 'Wednesday']); DayOfWeek::firstOrCreate(['name' => 'Thursday']); DayOfWeek::firstOrCreate(['name' => 'Friday']); DayOfWeek::firstOrCreate(['name' => 'Saturday']); }
private function getDay($day) { if ($day == 'Su') { return DayOfWeek::where('name', 'Sunday')->first(); } else { if ($day == 'Mo') { return DayOfWeek::where('name', 'Monday')->first(); } else { if ($day == 'Tu') { return DayOfWeek::where('name', 'Tuesday')->first(); } else { if ($day == 'We') { return DayOfWeek::where('name', 'Wednesday')->first(); } else { if ($day == 'Th') { return DayOfWeek::where('name', 'Thursday')->first(); } else { if ($day == 'Fr') { return DayOfWeek::where('name', 'Friday')->first(); } else { if ($day == 'Sa') { return DayOfWeek::where('name', 'Saturday')->first(); } } } } } } } }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { DayOfWeek::destroy($id); }