두 개의 텍스트 필드와 두 개의 단추 (편집 및 삭제)가있는 양식이 있습니다. 편집 단추를 누르면 제대로 작동하지만 삭제 단추를 누르면 'MethodNotAllowedHttp' 예외. 다음과 같이 내 코드는 다음과 같습니다메서드가 허용되지 않음 Laravel의 HTTP 예외 5.4
Route::post('/doctors/update', '[email protected]');
Route::delete('/doctors/{doctor}/delete', '[email protected]');
어떤 도움에 감사드립니다 다음과 같이
<form action="/laboratory/doctors/update" method="POST">
{{ csrf_field() }}
{{ method_field('DELETE') }}
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" id="name" aria-describedby="name" value="{{ $doctor->name }}">
</div>
<div class="form-group">
<label for="percentage">Percentage:</label>
<input type="text" class="form-control" id="percentage" value="{{ $doctor->percentage }}">
</div>
<button type="submit" class="btn btn-success">Save Changes</button>
<a href="/laboratory/doctors/{{ $doctor->id }}/delete" class="btn btn-danger">Delete</a>
</form>
내 경로이다.
액션이'action = "/ laboratory/doctors/update"method = "POST"'와 같은 형식으로되어 있다고 생각합니다. 삭제 방법이 있으므로 오류가 발생했습니다! –