/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id, Request $request) { $users = \Blog\Notice::orderBy('created_at', 'desc')->where('id', $id)->get(); $comments = \Blog\Comments::orderBy('created_at', 'asc')->where('id_noticia', $id)->get(); return view('review', compact('users', 'comments', 'user')); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id, Request $request) { \Blog\Comments::destroy($id); $notice = \Blog\Notice::find($id); $cantidad = $request->cantidad - 1; $notice->fill(['comment' => $cantidad]); $notice->save(); Session::flash('message', 'Comentario borrado correctamente'); return back()->withInput(); }