我有如下生成的路线,并希望在页面上放置一个表单:
Route::get('suppliers/dashboards/{supplier}', ['uses'=>'SuppliersDashInvoiceController@index'])->middleware('auth');
Route::post('suppliers/dashboards/{supplier}', array( 'before' => 'csrf', 'uses' => 'SuppliersDashInvoiceController@iprocess'))->middleware('auth');
但是当使用Form laravel helper时,我收到与
相关的错误Missing required parameters for [Route: ] [URI: suppliers/dashboards/{supplier}]
表格助手:
{!! Form::open(array('action' => array('SuppliersDashInvoiceController@iprocess'))) !!}
有没有人知道如何将{supplier}
参数传递给表单打开助手,它没有记录在laravel文档中。
答案 0 :(得分:4)
您需要传递参数,例如:
{!! Form::open(['action' => ['SuppliersDashInvoiceController@iprocess', $supplier->id]]) !!}