0

I've a laravel route

Route::get('/find/mobiles','SearchController@byCategory');

I want send values to byCategory method from the route file, something like $category='mobile' or $category = 'television'

I'm unable to find any way to do it.

runningmark
  • 738
  • 4
  • 13
  • 32

1 Answers1

0

Route:

Route::get('find/{category}, 'SearchController@byCategory');

Controller:

Public function byCategory($category){
  ... $category is whatever is passed from the route ...
}
Joe
  • 4,618
  • 3
  • 28
  • 35