Pass fixed variable from route to controller in Laravel
I'm trying to pass a variable through my route to my controller, but I have multiple routes (categories) leading to the same controller i.e. Route::get('/category1/{region}/{suburb?}', 'SearchController@search'); Route::get('/category2/{region}/{suburb?}', 'SearchController@search'); Making /category1, 2, etc. to be a parameter /{category} is not an option and I don't want to make separate controller function for each category. How do I send the first segment of the url to my search controller? i.e. category1 or category2? At present controller is as follows: public function search($region,