From 0f52d80ca67a49258b235f5831163dd72fbd54cf Mon Sep 17 00:00:00 2001 From: Frankie B Date: Tue, 11 Jun 2024 18:02:01 +0100 Subject: Merge MVC rewrite into master (#21) * Just commit it all * Require auth * crap * Update homepage * Block AI scrapers * Update cache update script * Add dummy file * Remove unnecessary lastfm config var * Use withQueryParameters for LastFM API * Fix embeds * Update example env * Smard --- routes/web.php | 111 ++++++++++++++------------------------------------------- 1 file changed, 27 insertions(+), 84 deletions(-) (limited to 'routes/web.php') diff --git a/routes/web.php b/routes/web.php index d9b39c6..b87d32d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,8 +1,15 @@ name('guestbook'); - -Route::post('/guestbook', 'App\Http\Controllers\GuestbookController@guestbookpost') - ->name('guestbookPost') +Route::get('/', [HomeController::class, 'show']); +Route::get('/bookmarks', [BookmarksController::class, 'show']); +Route::get('/guestbook', [GuestbookController::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!'); -//}); +Route::get('/calculators', [CalculatorsController::class, 'show']); +Route::get('/computers', [ComputersController::class, 'show']); +Route::get('/music', [MusicController::class, 'show']); + +// Admin pages +Route::get('/admin/guestbook', [AdminGuestbookController::class, 'show']) + ->middleware('auth'); +Route::get('/admin/bookmarks', [AdminBookmarksController::class, 'show']) + ->middleware('auth'); +Route::get('/admin/import', [AdminImportController::class, 'show']) + ->middleware('auth'); +Route::post('/admin/import', [AdminImportController::class, 'submit']) + ->name('admin.import.submit') + ->middleware('auth'); -- cgit v1.2.3-54-g00ecf