Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel Customizing Missing Model Behavior

use AppHttpControllersLocationsController;
use IlluminateHttpRequest;
use IlluminateSupportFacadesRedirect;

Route::get('/locations/{location:slug}', [LocationsController::class, 'show'])
        ->name('locations.view')
        ->missing(function (Request $request) {
            return Redirect::route('locations.index');
        });
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #Laravel #Customizing #Missing #Model #Behavior
ADD COMMENT
Topic
Name
4+7 =