I was working on an admin panel using backpack for laravel. When I wan't to delete some item by hitting the delete button, I get a Not Deleted error - see screenshots.
It looks like the 403 and 405 errors that can occur when the CRUD::resource()
or Route::resource
method are used but the server (apache in my case) does not allow them on dynamic ressources - whatever that means in detail ...
Is there a way to enable these methods on apache?
I got it working, but I would like to use the default HTTP Methods
Quick Fix
I was able to fix this problem by duplicating and modifying the list.blade.php
crud view of backpack.
-
Duplicate the view
vendor/backpack/crud/src/resources/views/list.blade.php
and move it toresources/views/vendor/backpack/crud/list.blade.php
-
Go ahead and modify the ajax request defined on line 271.
if (confirm("") == true) { $.ajax({ url: delete_url, type: 'POST', // change from DELETE to POST data: { // "spoof" the HTTP verb "DELETE" "_method": "DELETE" },
via Thomas Venturini