왜 이런 일이 발생합니까? 이것은 모든 계정의 색인 목록입니다. 난 그냥 그 category.destroy 경로에 의해 특정 범주를 삭제할하지만Laravel Destroy 삭제하지 않는 옵션
index.blade.php
@extends('layouts.master')
@section('title','All Categories')
@section('contents')
<div class="row">
<div class="col-md-8 col-sm-4 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">All Categories</div>
<div class="panel-body">
<article>
<div class="table-responsive-vertical shadow-z-1">
<!-- Table starts here -->
<table id="table" class="table table-hover table-mc-light-blue">
<thead>
<tr>
<th>ID No</th>
<th>Category</th>
<th>Edit/Delete</th>
<th>Status</th>
</tr>
</thead>
@foreach($categories as $category)
<tbody>
<tr>
<td data-title="ID">{{$category->id}}</td>
<td data-title="Name">{{$category->name}}</td>
<td><a href="{{ route('category.edit',$category->id) }}" class="btn btn-primary btn-sm pull-left">Edit</a>
 <a href="{{ route('category.destroy', $category->id) }}" class="btn btn-danger btn-sm">Delete</a>
</td>
</tr>
</tbody>
@endforeach
</table>
</div>
</article>
</div>
</div>
</div>
</div>
@endsection
@section('js')
{!!Html::script('assets/js/jquery.min.js')!!}
{!!Html::script('assets/js/bootstrap.min.js') !!}
<script>
$('#flash-overlay-modal').modal();
</script>
<script>
$('div.alert').not('.alert-important').delay(3000).fadeOut(350);
</script>
@endsection
의 CategoryController.php
public function destroy($id){
$category = Category::findOrFail($id);
$category->delete();
Session::flash('flash_message', 'Task successfully deleted!');
return redirect()->route('category.index');
}
대신 그냥보기 특정 항목을 표시합니다 카테고리의 이 경로에 뭔가를
경로에 대한 링크를 작성하면 파괴 경로가'GET'이 아니므로 실제로는 해당 경로에 액세스하지 않고 있으므로'DELETE'이므로 실제로는 파괴 경로에 작은 양식을 작성해야합니다 버튼을 사용하여 양식 작업을 실제 경로로 트리거 할 수 있습니다. –