Answer the question
In order to leave comments, you need to log in
How to assign a default value to an optional variable in Laravel routing?
The documentation says to do this
Route::get('user/{name?}', function($name = null)
{
return $name;
});
Route::get('date/{date?}', '[email protected]')->name('ajax.matches.date')->middleware('enter');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question