【发布时间】:2021-09-13 20:40:20
【问题描述】:
我正在使用
web.php 内:
Route::post('/delete',[PostController::class,'destroy'])->name('post.delete');
&&
刀片模板内:
<form method="POST" class="d-inline" action="{{route('post.delete')}}">
@csrf
<input type="hidden" name="slug" value="{{ $post->slug }}">
<button type="submit" class="btn px-0 d-inline">Delete</button>
</form>
问题是:当我点击删除按钮时,抛出 404 异常
Github 仓库:https://github.com/Khokon-Chandra/Blog-Backend.git
【问题讨论】:
-
你是不是错过了那里的路由模型绑定???
标签: routes http-status-code-404 laravel-8