我controller
用resource
. 我在其中创建了一个自定义函数,但是当我在其中使用它时,route
它blade.php
说它没有定义。
非常感谢任何有关错误和解释的帮助!
刀
<div class="modal fade" id="issueModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="{{route('inventory.deduct')}}" method="post">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Save changes</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</form>
</div>
</div>
</div>
控制器内部的自定义函数
public function deduct(Type $var = null)
{
dd("test");
}
路线
Route::resource('inventory', 'InventoryController');