Esempio n. 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(\App\Http\Requests\CommentFormRequest $request)
 {
     $data = $request->all();
     $comment = \App\Models\Comment::create($data);
     $comment->save();
     return redirect('posts/' . $comment->post->id);
 }
Esempio n. 2
0
 /**
  * Store a newly created comment in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CommentFormRequest $request)
 {
     $input = $request->all();
     //dd($input);
     Comment::create($input);
     Session::flash('flash_message', 'Váš komentář byl přidán.');
     return redirect()->back();
 }
Esempio n. 3
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  CommentFormRequest $request
  * @return Response
  */
 public function store(CommentFormRequest $request)
 {
     $comment = Comment::create($request->all());
     return redirect()->back()->with('message', 'thanks for your attention');
 }