此错误消息一直显示
Missing required parameters for [Route: merchants.add.channel] [URI: merchants/{key}/denomination/{keydenom}/channel/addChannel].
这是我的路线
Route::get('merchants/{key}/denomination/{keydenom}/channel', 'MerchantsController@channel')->name('merchants.channel');
这是我的功能
public function channel($id)
{
if (!can('merchants_list_channel')) {
return redirect()->route('home');
}
$merchant = MerchantDenomination::where('id', $id)->pluck('name')->first();
$statusDenomList = [
'' => '-- All --',
'ACTIVE' => 'Active',
'DISABLE' => 'Disable',
'OFS' => 'OFS'
];
return view('merchants.channel', compact('statusDenomList', 'id', 'merchant'));
}
答案 0 :(得分:0)
该路线有2个路线参数:{key}和{keydenom}。
您的控制器功能应该同时满足它们:
public function channel($key, $keydom) {
// Do your job
}
每次拨打route()
时,您还需要表达参数:
route('merchants.channel', ['key' => "your-key", 'keydom' => "your-keydom"])