Ad

Method App\Http\Controllers\Controller::create2/{sku} Does Not Exist

- 1 answer

How to pass a value in the route of laravel, I have tried to pass SKU in the laravel but it's showing me the error.

$sku = $request->SKU_code;
return redirect()->route('create.step2',['sku', $sku]);

route

Route::get('create/step-2', [email protected]/{sku}')->name('create.step2');
Ad

Answer

You should pass parameter like below:

$sku = $request->SKU_code;
return redirect()->route('create.step2',['sku', $sku]);

Route::get('create/step-2/{sku}', '[email protected]')->name('create.step2');
Ad
source: stackoverflow.com
Ad