我的某个表单上的DELETE请求会抛出NotFoundHttpException
路线:
itemsTypes = [ 'foo', 'bar' ]
Route::delete('{type}/{id}/delete', 'ItemTaxonomyController@destroy')
->where('type', $itemsTypes);
使用它的表格:
{!! Form::open( [action('ItemTaxonomyController@destroy', [$type, $item->item_id]), 'delete']) !!}
<button type="submit">Delete</button>
{!! Form::close() !!}
答案 0 :(得分:0)
您正在错误地打开表单。取代
{!! Form::open( [action('ItemTaxonomyController@destroy', [$type, $item->item_id]), 'delete']) !!}
与
{!! Form::open( [ 'url' => action('ItemTaxonomyController@destroy', [$type, $item->item_id]), 'method' => 'delete']) !!}