Hello, I'm new to Laravel and I was wondering if you can leave a default route in case someone misses the typed route, the return is from the return page.
Hello, I'm new to Laravel and I was wondering if you can leave a default route in case someone misses the typed route, the return is from the return page.
A simple way to resolve this:
Route::any('{any}', function () {
return redirect('/');
});
'any' refers to 'anyone'. So regardless of the used HTTP verb or the typed route it would return to home ('/').
More details can be found at laravel documentation .