diff options
Diffstat (limited to 'routes/web.php')
-rw-r--r-- | routes/web.php | 99 |
1 files changed, 14 insertions, 85 deletions
diff --git a/routes/web.php b/routes/web.php index d9b39c6..0b10251 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,8 +1,12 @@ <?php -use Illuminate\Support\Facades\DB; +use App\Http\Controllers\BookmarksController; +use App\Http\Controllers\CalculatorsController; +use App\Http\Controllers\ComputersController; +use App\Http\Controllers\GuestbookController; +use App\Http\Controllers\HomeController; +use App\Http\Controllers\MusicController; use Illuminate\Support\Facades\Route; -use Illuminate\Support\Facades\View; /* |-------------------------------------------------------------------------- @@ -15,87 +19,12 @@ use Illuminate\Support\Facades\View; | */ -Route::get('/', function () { - return View::make('pages.home'); -}); - -Route::get('/bookmarks', function () { - return View::make('pages.bookmarks'); -}); - -Route::get('/projects', function () { - return View::make('pages.projects'); -}); - -Route::get('/calculators', function () { - return View::make('pages.calculators'); -}); - -Route::get('/computers', function () { - return View::make('pages.computers'); -}); - -Route::get('/guestbook', 'App\Http\Controllers\GuestbookController@guestbook') - ->name('guestbook'); - -Route::post('/guestbook', 'App\Http\Controllers\GuestbookController@guestbookpost') - ->name('guestbookPost') +// Run the PageView middleware for *all* public GET routes +Route::get('/', [HomeController::class, 'show']); +Route::get('/bookmarks', [BookmarksController::class, 'show']); +Route::get('/guestbook', [GuestbookController::class, 'show']); +Route::get('/calculators', [CalculatorsController::class, 'show']); +Route::get('/computers', [ComputersController::class, 'show']); +Route::get('/music', [MusicController::class, 'show']); +Route::post('/guestbook', [GuestbookController::class, 'addEntry']) ->middleware('rate_limit'); - -Route::get('/weather', function () { - return View::make('pages.weather'); -}); - -Route::get('/music', function () { - return View::make('pages.music'); -}); - -Route::get('/bot', function () { - return View::make('pages.bot'); -}); - -/* ------------------------------ 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!'); -//}); - |