title: how to define two parameter in laravel route
body: <p>im using laravel 5.4 and i have a brands and a products table. i want to define two parameter in route and get them in controller or RouteServiceProvider to search.</p>
  
  <p>imagine : site.com/samsung/   =>  get all products with samsung brand.</p>
  
  <p>and     : site.com/samsung/galaxys8  =>  get all products with samsung brand and galaxys8 model</p>
  
  <p>i can define this using two separate route and controller method : (define route one with 1 parameter{brand} and controller@method1 and define route two with 2 parameters {brand}/{product} and controller@method2)</p>
  
  <p>can i do this better? im a little new in laravel . thank you</p>
  
  <pre><code>Route::get('/{brand}', 'AdvertismentController@show');
  Route::get('/{brand}/{product}', 'AdvertismentController@show2');
  
  
  
  public function show($brand)
  {
          $brands = Advertisment::where('brand' , $brand)-&gt;get();
          return $brands;
  }
  
  public function show2($brand , $product)
  {
      $products = Advertisment::where('product' , $product)-&gt;get();
      return $products;
  }
  </code></pre>