/** * Run the database seeds. * * @return void */ public function run() { $presentation_types = ["Paper", "Poster", "Art", "Music", "Drama"]; foreach ($presentation_types as $type) { try { PresentationType::create(['description' => $type]); } catch (Exception $e) { print $type . " already exists.\n"; } } }
private function prepare_form($presentation, $action) { $user = Auth::user(); if ($user->is_professor()) { $courses = $user->courses()->where('offered_this_semester', true)->get(); } else { $courses = Course::where('offered_this_semester', true)->orderBy('subject_code', 'asc')->orderBy('number')->get(); } $presentation_types = PresentationType::all(); $students = $presentation->students(); return view('presentations.' . $action, compact('courses', 'presentation_types', 'presentation', 'students')); }