Exemple #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($title)
 {
     $post = Posts::where('title', $title)->first();
     return view('blog-item', compact('post'));
 }
Exemple #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Posts::find($id)->delete();
     flash()->success('Deleted', 'Post deleted');
     return redirect('/admin/posts');
 }