Files
newznab-tmux-NNTmux/app/Http/Controllers/Admin/CommentsController.php
T
2019-02-26 22:26:42 +01:00

40 lines
905 B
PHP

<?php
namespace App\Http\Controllers\Admin;
use App\Models\ReleaseComment;
use App\Http\Controllers\BasePageController;
class CommentsController extends BasePageController
{
/**
* @throws \Exception
*/
public function index()
{
$this->setAdminPrefs();
$meta_title = $title = 'Comments List';
$commentsList = ReleaseComment::getCommentsRange();
$this->smarty->assign('commentslist', $commentsList);
$content = $this->smarty->fetch('comments-list.tpl');
$this->smarty->assign(compact('title', 'meta_title', 'content'));
$this->adminrender();
}
/**
* @param $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
{
if ($id) {
ReleaseComment::deleteComment($id);
}
return redirect()->back();
}
}