I have a categories page and create a remove button which to remove it the categories, the image as below:
So the problem is show me 'MethodNotAllowedHttpException'
Alright. Here is Route file
Route::delete('removeCategory/{id}','AdminController@removeCategory');
Controller file
public function removeCategory(Request $id){
$cats = cats::find($id);
$cats->delete();
}
and View file
@foreach($data as $product)
<tr style="height:50px">
<td style="padding:10px">{{$product->cat_name}}</td>
<td><a class="btn btn-sm btn-fill btn-primary"
href="{{url('/admin/editCategory')}}/{{$product->id}}">Edit</a></td>
<td><a href="{{url('admin/removeCategory')}}/{{$product->id}}" onclick="return confirm('Are you sure?')"
class="btn btn-sm btn-fill btn-primary">Remove</a></td>
</tr>
@endforeach
Thanks for anyone share the info to me, I have tried it but showing me this error message.
