/**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(ItemRequest $request, $course_url, $stage_url)
 {
     $name = $request->name;
     $url = UrlSanitizer::sanitize($name);
     $request["url"] = $url;
     $item = Item::create($request->all());
     return redirect()->route('items.index', ['course_url' => $course_url, 'stage_url' => $stage_url]);
 }
 /**
  * Actualiza un curso por su ID
  * 
  * @param Request
  * @param Int id
  */
 public function update(CourseRequest $request, $id)
 {
     $name = $request->name;
     $url = UrlSanitizer::sanitize($name);
     $request["url"] = $url;
     $curso = Course::find($id);
     $curso->update($request->all());
     return redirect()->route('courses.index');
 }
 /**
  * Actualiza la categoria en la BD
  * 
  * @param CategoryRequest
  * @param int id
  */
 public function update(CategoryRequest $request, $id)
 {
     $name = $request->name;
     $url = UrlSanitizer::sanitize($name);
     $request["url"] = $url;
     $categoria = Category::find($id);
     $categoria->update($request->all());
     return redirect()->route('categories.index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(StageRequest $request, $course_url, $id)
 {
     $name = $request->name;
     $url = UrlSanitizer::sanitize($name);
     $request["url"] = $url;
     $stage = Stage::find($id);
     $stage->update($request->all());
     return redirect()->route('stages.index', ['course_url' => $course_url]);
 }