1
进出口工作在已保存的产品的编辑,我在我的浏览器收到以下错误消息缺少参数1为App HTTP 控制器的ProductsController ::编辑()
ErrorException in ProductsController.php line 88:
Missing argument 1 for App\Http\Controllers\ProductsController::edit()
in ProductsController.php line 88
我的路线控制器如下图所示:
Route::get('productsedit', array('as'=> '/productsedit','uses'=>'[email protected]'));
的功能如下
public function edit($id)
{
//find the post in the db and sav it as a variable
$product = Products:: findOrFail($id);
//return view and pass in the var previously created
return view('/productsedit')->withProducts($product);
}
亚姆在哪里我会错
更多信息请 –
什么是产品?尝试使用view('/ productsedit',compact($ product)); – GuaHsu
你能展示你如何链接到这条路线吗? –