Laravel - default route

Asked

Viewed 96 times

2

Hello I’m new in Laravel and I was wondering if you can leave a default route in case someone misses the route typed in the Return page

1 answer

1


A simple way to solve this:

Route::any('{any}', function () {
    return redirect('/');
});

any refers to 'anyone'. Then regardless of the HTTP verb used or the route typed it would return to home ('/').

More details you can find on the documentation of the Arable.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.