Import View facade in web routes

This commit is contained in:
floppydiskette 2023-12-05 00:19:48 +00:00
parent bbdb90c867
commit de13463427
Signed by: fwoppydwisk
SSH key fingerprint: SHA256:yXxSuswzElTluzXjKgvZK0bDGhTaj/XbArybRDr+Mfs

View file

@ -2,6 +2,7 @@
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\View;
/*
|--------------------------------------------------------------------------
@ -15,23 +16,23 @@
*/
Route::get('/', function () {
return view('pages.home');
return View::make('pages.home');
});
Route::get('/bookmarks', function () {
return view('pages.bookmarks');
return View::make('pages.bookmarks');
});
Route::get('/projects', function () {
return view('pages.projects');
return View::make('pages.projects');
});
Route::get('/calculators', function () {
return view('pages.calculators');
return View::make('pages.calculators');
});
Route::get('/computers', function () {
return view('pages.computers');
return View::make('pages.computers');
});
Route::get('/guestbook', 'App\Http\Controllers\GuestbookController@guestbook')
@ -42,36 +43,36 @@
->middleware('rate_limit');
Route::get('/weather', function () {
return view('pages.weather');
return View::make('pages.weather');
});
Route::get('/music', function () {
return view('pages.music');
return View::make('pages.music');
});
Route::get('/bot', function () {
return view('pages.bot');
return View::make('pages.bot');
});
/* ------------------------------ Admin Routes ------------------------------ */
Route::get('/admin', function () {
if (!auth()->check()) {
return view('errors.no-auth');
return View::make('errors.no-auth');
}
return view('pages.admin.index');
return View::make('pages.admin.index');
});
Route::get('/admin/guestbook', function () {
if (!auth()->check()) {
return view('errors.no-auth');
return View::make('errors.no-auth');
}
return view('pages.admin.guestbook');
return View::make('pages.admin.guestbook');
});
Route::get('/admin/guestbook/delete', function () {
if (!auth()->check()) {
return view('errors.no-auth');
return View::make('errors.no-auth');
}
$id = request()->input('id');
@ -79,9 +80,9 @@
if ($entry) {
// Render a confirmation view
return view('pages.admin.guestbook-del-confirm', compact('entry'));
return View::make('pages.admin.guestbook-del-confirm', compact('entry'));
} else {
return view('errors.generic-error')
return View::make('errors.generic-error')
->with('error', "Entry not found")
->with('description', "The specified entry does not exist!");
}
@ -89,7 +90,7 @@
Route::post('/admin/guestbook/delete', function () {
if (!auth()->check()) {
return view('errors.no-auth');
return View::make('errors.no-auth');
}
$id = request()->input('id');