Answers for "Laravel Customizing Missing Model Behavior"

PHP
0

Laravel Customizing Missing Model Behavior

use App\Http\Controllers\LocationsController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;

Route::get('/locations/{location:slug}', [LocationsController::class, 'show'])
        ->name('locations.view')
        ->missing(function (Request $request) {
            return Redirect::route('locations.index');
        });
Posted by: Guest on October-04-2021

Browse Popular Code Answers by Language