CommentController.php 508 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use App\Models\Comment;
  5. class CommentController extends Controller
  6. {
  7. function moderation() {
  8. $comments = Comment::with("commentable")->pending()->recent()->get();
  9. return view("comment_moderation_queue", ["comments" => $comments]);
  10. }
  11. function allow(Comment $comment) {
  12. $comment->allow();
  13. return view("success");
  14. }
  15. function reject(Comment $comment) {
  16. $comment->reject();
  17. return view("success");
  18. }
  19. }