Laravel - Routing - Encoded Forward Slashes

The Laravel routing component allows all characters except / to be present within route parameter values. You must explicitly allow / to be part of your placeholder using a where condition regular expression:

Route::get('/search/{search}', function ($search) {
    return $search;
})->where('search', '.*');
Encoded forward slashes are only supported within the last route segment.