/** * Store a newly created resource in storage. * * @param Requests\StoreCommentFormRequest|Request $request * @return Response */ public function store(Requests\StoreCommentFormRequest $request) { Comment::create($request->all()); return back()->with('message', 'Commentaire en attente de validation'); }
/** * Update the specified resource in storage. * * @param Requests\StoreCommentFormRequest|Request $request * @param int $id * @return Response */ public function update(Requests\StoreCommentFormRequest $request, $id) { $comment = Comment::find((int) $id); $comment->update($request->all()); return redirect('dashboard/comment')->with('message', 'Commentaire modifié'); }