public function post(Requests\CreatePostRequest $request)
 {
     $title = input::get('title');
     $body = input::get('body');
     $id = Auth::user()->id;
     Post::create(['title' => $title, 'body' => $body, 'user_id' => $id, 'created_at' => Carbon::now()]);
     return redirect::back();
 }
Exemplo n.º 2
0
 public function post(Requests\CreatePostRequest $request)
 {
     Auth::user()->posts()->create($request->all());
     return redirect::back();
 }