Laravel - default route

2

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.

    
asked by anonymous 08.10.2018 / 16:40

1 answer

1

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 .

    
08.10.2018 / 23:09