Disable admin routes
This commit is contained in:
parent
27140bd257
commit
08c8d3e06b
1 changed files with 42 additions and 42 deletions
|
@ -56,46 +56,46 @@
|
||||||
|
|
||||||
/* ------------------------------ Admin Routes ------------------------------ */
|
/* ------------------------------ Admin Routes ------------------------------ */
|
||||||
|
|
||||||
Route::get('/admin', function () {
|
//Route::get('/admin', function () {
|
||||||
if (!auth()->check()) {
|
// if (!auth()->check()) {
|
||||||
return View::make('errors.no-auth');
|
// return View::make('errors.no-auth');
|
||||||
}
|
// }
|
||||||
return View::make('pages.admin.index');
|
// return View::make('pages.admin.index');
|
||||||
});
|
//});
|
||||||
|
//
|
||||||
Route::get('/admin/guestbook', function () {
|
//Route::get('/admin/guestbook', function () {
|
||||||
if (!auth()->check()) {
|
// if (!auth()->check()) {
|
||||||
return View::make('errors.no-auth');
|
// return View::make('errors.no-auth');
|
||||||
}
|
// }
|
||||||
return View::make('pages.admin.guestbook');
|
// return View::make('pages.admin.guestbook');
|
||||||
});
|
//});
|
||||||
|
//
|
||||||
Route::get('/admin/guestbook/delete', function () {
|
//Route::get('/admin/guestbook/delete', function () {
|
||||||
if (!auth()->check()) {
|
// if (!auth()->check()) {
|
||||||
return View::make('errors.no-auth');
|
// return View::make('errors.no-auth');
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
$id = request()->input('id');
|
// $id = request()->input('id');
|
||||||
$entry = DB::table('guestbook__entries')->find($id);
|
// $entry = DB::table('guestbook__entries')->find($id);
|
||||||
|
//
|
||||||
if ($entry) {
|
// if ($entry) {
|
||||||
// Render a confirmation view
|
// // Render a confirmation view
|
||||||
return View::make('pages.admin.guestbook-del-confirm', compact('entry'));
|
// return View::make('pages.admin.guestbook-del-confirm', compact('entry'));
|
||||||
} else {
|
// } else {
|
||||||
return View::make('errors.generic-error')
|
// return View::make('errors.generic-error')
|
||||||
->with('error', "Entry not found")
|
// ->with('error', "Entry not found")
|
||||||
->with('description', "The specified entry does not exist!");
|
// ->with('description', "The specified entry does not exist!");
|
||||||
}
|
// }
|
||||||
});
|
//});
|
||||||
|
//
|
||||||
Route::post('/admin/guestbook/delete', function () {
|
//Route::post('/admin/guestbook/delete', function () {
|
||||||
if (!auth()->check()) {
|
// if (!auth()->check()) {
|
||||||
return View::make('errors.no-auth');
|
// return View::make('errors.no-auth');
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
$id = request()->input('id');
|
// $id = request()->input('id');
|
||||||
DB::table('guestbook__entries')->where('id', $id)->delete();
|
// DB::table('guestbook__entries')->where('id', $id)->delete();
|
||||||
|
//
|
||||||
return back()->with('success', 'Entry deleted successfully!');
|
// return back()->with('success', 'Entry deleted successfully!');
|
||||||
});
|
//});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue