如何使Form :: model具有多個參數? 我有這樣的例子路線。 www.domain.com/product/2/product-attributes/3/edit 在正常的形式,我可以做這樣的:L5表單模型綁定多個參數
<form method="POST" action="{{ route('product.{product}.product-attributes.update', [$product->id, $product-attribute->id ]) }}"> </form>
,但如果我嘗試使用laravelcolective/HTML表單::模型( )是這樣的:
Form::model($productattributes, array('method' => 'POST', array('route' => array('product.{product}.product-attributes.update', [$product->id, $product-attribute->id ])))
我得到一個錯誤數組字符串轉換...
==== UPDATE ==============
條我的路線:
Route::resource('backend/product', 'Backend\ProductController');
Route::resource('backend/product/{product}/product-attributes', 'Backend\ProductAttributesController',['except' => ['index']]);
=====更新2 =========================
它只是錯字:X,我已經更新我的路線..我使用路線::資源。除了當我使用Laravelcollective HTML/Form時,我沒有任何問題:Form :: model – GandhyOnly
如果您使用的是路由資源,請運行'artisan route:list'來獲取路由的正確名稱,我很漂亮肯定它不是'產品。{product} .product-attributes.update' – haakym
解決了,但如果你問我的路線:列表來證明我的路線,你可以看到我的更新@haakym – GandhyOnly