mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 23:01:31 +00:00
40 lines
879 B
PHP
40 lines
879 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use App\Http\Controllers\BasePageController;
|
|
use App\Models\ReleaseComment;
|
|
use Illuminate\Http\RedirectResponse;
|
|
use Illuminate\View\View;
|
|
|
|
class AdminCommentsController extends BasePageController
|
|
{
|
|
/**
|
|
* Display a listing of comments
|
|
*/
|
|
public function index(): View
|
|
{
|
|
$this->setAdminPrefs();
|
|
|
|
$meta_title = $title = 'Comments List';
|
|
|
|
$commentsList = ReleaseComment::getCommentsRange();
|
|
|
|
return view('admin.comments.index', compact('commentsList', 'title', 'meta_title'));
|
|
}
|
|
|
|
/**
|
|
* Delete a comment
|
|
*/
|
|
public function destroy(int $id): RedirectResponse
|
|
{
|
|
if ($id) {
|
|
ReleaseComment::deleteComment($id);
|
|
}
|
|
|
|
return redirect()->back()->with('success', 'Comment deleted successfully');
|
|
}
|
|
}
|