/**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @return \Illuminate\Http\Response
  */
 public function store(saveCourseRequest $request)
 {
     $course = new Course($request->except(['department', 'semester']));
     $department = Department::where('code', $request->input('department'))->first();
     $semester = Semester::find($request->input('semester'));
     $course->department()->associate($department);
     $course->semester()->associate($semester);
     $course->save();
     $request->session()->flash('status', 'Course was saved successful!');
     return back();
 }