validate([ 'author_name' => 'required|max:255', 'author_email' => 'required|email', 'content' => 'required|max:1000', ]); $post->comments()->create($validated); return redirect()->route('posts.show', $post) ->with('success', 'Комментарий отправлен на модерацию'); } public function moderate() { $comments = Comment::pending()->with('post')->latest()->paginate(20); return view('comments.moderate', compact('comments')); } public function approve(Comment $comment) { $comment->approve(); return back()->with('success', 'Комментарий одобрен'); } public function reject(Comment $comment) { $comment->reject(); return back()->with('success', 'Комментарий отклонен'); } }