public function update(Request $request, Blog $blog, BlogPost $blogPost, Photo $photo) { // extra validation specific to adding an inscription $validator = $this->requireInscription($request->all()); if ($validator->fails()) { $this->throwValidationException($request, $validator); } $photo->inscription_title = $request['inscription_title']; $photo->inscription_content = $request['inscription_content']; $photo->save(); return redirect(route('blog.blogPost.edit', ['blog' => getUrlForThisName($blog), 'blogPost' => getUrlForThisName($blogPost)])); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(BlogValidationRequest $request, Blog $blog) { $blog->update($request->all()); return redirect(route('blog.show', ['blog' => getUrlForThisName($blog)])); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy(Blog $blog, BlogPost $blogPost) { $blogPost->delete(); return Redirect::route('blog.edit', ['blog' => getUrlForThisName($blog)]); }