I have the following route:
Route::get('users/search/{type?}/{value}', 'Site\UserController@search');
The main idea is to simplify the search:
if type exists (name, surname, email and etc.) search only by that field.
if not - search everywhere.
But when I do:
http://example.com/users/search/sdgfdfxg
Laravel throws
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
With
http://example.com/users/search/name/sdgfdfxg
or
http://example.com/users/search/surname/sdgfdfxg
everything is fine.