我有一個數據庫表,每行都有一個主鍵,名爲id。我想打一個頁面要刪除的ID與下面的表單提交該行:Laravel使用ResourceController從輸入表單(在* .blade.php中)路由到<ResourceController> .destroy
<form action="{{ route('Account.destroy') }}" method="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="text" name="id">
<button type="submit"> Delete My Account </button>
</form>
但期望的格式沒有工作!
我發現我需要的ID進行到{{路線()}},所以我嘗試{{路線( '[' Account.destroy 'ID')然後這些錯誤出現:
The errors' page with conducted id to route()
我知道這是錯誤的方法在航線([「Account.destroy」,ID]),但我沒有任何想法來解決這個問題。請幫幫我!謝謝!
P/s:對不起,如果我的英語太差!
好吧,我會試着用更多的這樣的格式,感謝 –