user()->hasPermission("approve_all_comments")) { $comments = Comment::all(); } else { $comments = auth()->user()->comments; } return view("dashboard.comments.index")->with([ "comments" => $comments] ); } public function confirm(Request $request, $id) { $comment = Comment::find($id); $comment->is_active = true; $comment->confirmed_date = now(); $comment->save(); Alert::flash("Comment confirmed successfully"); return redirect()->route("dashboard.comments.index"); } public function destroy(Request $request, $id) { Comment::find($id)->delete(); Alert::flash("Comment deleted successfully"); return redirect()->route("dashboard.comments.index"); } }