Laravel Route two parameters

September 7, 2020

To pass multiple parameters with Laravel route you can define your route

Route::get('/{form}/{step?}', 'FormController@show');
public function show($brand, $product = null)
{
    if (!is_null($product)) {
        $results = Advertisment::where('product' , $product)->get();
    } else {
        $results = Advertisment::where('brand' , $brand)->get();
    }

    return $results;
}