/**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $title = 'Blog';
     $post = PostRepository::find($id);
     return view('blog.show')->with(compact('title', 'post'));
 }
Ejemplo n.º 2
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(PostFormRequest $request)
 {
     $data = array('title' => $request->get('title'), 'content' => $request->get('content'), 'description' => $request->get('description'), 'user_id' => \Auth::user()->id);
     PostRepository::create($data);
     return \Redirect::route('post.create')->with('message', 'Your post has been created!');
 }