芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/reginaeigbe.com/folder/admin/tmp/app/Http/Controllers/Admin/CommentController.php
search ?: ''; $data['sort']['column'] = $request->sort['column'] ?? ''; $data['sort']['order'] = $request->sort['order'] ?? 'asc'; $data['comments'] = $repository->paginateSearchResult($data['search'], $data['sort']); return Inertia::render('Comments/Index', $data); } /** * Approved Comment * * @param Comment $comment * @param CommentRepository $repository * @return RedirectResponse */ public function approved(Comment $comment, CommentRepository $repository): RedirectResponse { $repository->approved($comment); return back()->with('success', 'Comment successfully approved!'); } /** * UnApproved Comment * * @param Comment $comment * @param CommentRepository $repository * @return RedirectResponse */ public function unApproved(Comment $comment, CommentRepository $repository): RedirectResponse { $repository->unApproved($comment); return back()->with('success', 'Comment successfully unapproved!'); } /** * destroy comment * * @param Comment $comment * @return RedirectResponse */ public function destroy(Comment $comment): RedirectResponse { $comment->delete(); return back()->with('success', 'Comment successfully deleted'); } /** * Bulk Delete comments * * @param Request $request * @return RedirectResponse */ public function bulkDelete(Request $request): RedirectResponse { $ids = explode(',', $request->ids); Comment::destroy($ids); return back()->with('success', "Your selected comment successfully deleted"); } }