コード例 #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param ScheduleFormRequest $request
  * @return Response
  */
 public function store($course_id, ScheduleFormRequest $request)
 {
     $schedule = new Schedule();
     $schedule->fill($request->all());
     $schedule->course_id = $course_id;
     $schedule->save();
     return redirect()->route('courses.classes.index', $course_id)->with('flash', ['level' => 'success', 'message' => 'Added class in "' . $schedule->city . '".']);
 }