我需要一些幫助,請Laravel - 的hasMany CRUD - 更新
我有兩個表:運營商和銷售
Image of Yaktocat http://i67.tinypic.com/2uj6znn.png Image of Yaktocat http://i67.tinypic.com/er0c90.png
載波CRUD工作。出售CRUD也在工作,除了更新方法。
爲了更新,我需要carrierId和出售編號,對吧?
這是我CarrierSellController:
Image of Yaktocat http://i63.tinypic.com/2z40pjs.png
這是我運營商/銷售/ edit.blade.php
Image of Yaktocat http://i65.tinypic.com/2j2i8fs.png
模型結合工作:
Image of Yaktocat http://i65.tinypic.com/16lb1l.png
表單行爲在網址的末尾有/編輯。沒問題?
Image of Yaktocat http://i63.tinypic.com/25zmmas.png
如果我點擊提交按鈕,我得到這個錯誤:
Image of Yaktocat http://i65.tinypic.com/b3os2q.png
因爲路線/車riers/{carrierID}/sell/{id}/edit不聲明。 –
我建議你必須使用 - > where('id','[0-9] +'); –
在這張圖片上,你只需更新:我看到的方法是GET。請更改爲POST。 –