Comment::where('is_approved', false)->get()]); } public function store(Request $request, Post $post){ $comment = $post->comments()->create($request->validate([ 'author_name' => 'required', 'content' => 'required' ])); event(new CommentCreated($comment)); return back()->with('success', 'Комментарий отправлен на модерацию'); } public function approve($id) { $comment = Comment::findOrFail($id); $comment->update(['is_approved' => true]); return back()->with('success', 'Комментарий одобрен'); } }