From 08c8d3e06bcf3c0d6ace0f6e2f4ada568d3af22f Mon Sep 17 00:00:00 2001 From: Frankie B Date: Sun, 31 Dec 2023 02:04:42 +0000 Subject: [PATCH] Disable admin routes --- routes/web.php | 84 +++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/routes/web.php b/routes/web.php index 3cddf9a..d9b39c6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -56,46 +56,46 @@ /* ------------------------------ Admin Routes ------------------------------ */ -Route::get('/admin', function () { - if (!auth()->check()) { - return View::make('errors.no-auth'); - } - return View::make('pages.admin.index'); -}); - -Route::get('/admin/guestbook', function () { - if (!auth()->check()) { - return View::make('errors.no-auth'); - } - return View::make('pages.admin.guestbook'); -}); - -Route::get('/admin/guestbook/delete', function () { - if (!auth()->check()) { - return View::make('errors.no-auth'); - } - - $id = request()->input('id'); - $entry = DB::table('guestbook__entries')->find($id); - - if ($entry) { - // Render a confirmation view - return View::make('pages.admin.guestbook-del-confirm', compact('entry')); - } else { - return View::make('errors.generic-error') - ->with('error', "Entry not found") - ->with('description', "The specified entry does not exist!"); - } -}); - -Route::post('/admin/guestbook/delete', function () { - if (!auth()->check()) { - return View::make('errors.no-auth'); - } - - $id = request()->input('id'); - DB::table('guestbook__entries')->where('id', $id)->delete(); - - return back()->with('success', 'Entry deleted successfully!'); -}); +//Route::get('/admin', function () { +// if (!auth()->check()) { +// return View::make('errors.no-auth'); +// } +// return View::make('pages.admin.index'); +//}); +// +//Route::get('/admin/guestbook', function () { +// if (!auth()->check()) { +// return View::make('errors.no-auth'); +// } +// return View::make('pages.admin.guestbook'); +//}); +// +//Route::get('/admin/guestbook/delete', function () { +// if (!auth()->check()) { +// return View::make('errors.no-auth'); +// } +// +// $id = request()->input('id'); +// $entry = DB::table('guestbook__entries')->find($id); +// +// if ($entry) { +// // Render a confirmation view +// return View::make('pages.admin.guestbook-del-confirm', compact('entry')); +// } else { +// return View::make('errors.generic-error') +// ->with('error', "Entry not found") +// ->with('description', "The specified entry does not exist!"); +// } +//}); +// +//Route::post('/admin/guestbook/delete', function () { +// if (!auth()->check()) { +// return View::make('errors.no-auth'); +// } +// +// $id = request()->input('id'); +// DB::table('guestbook__entries')->where('id', $id)->delete(); +// +// return back()->with('success', 'Entry deleted successfully!'); +//});