0👍
It’s high chance that delete url you try to send and route url are not the same, please check network and route:list, if not then you probably define your spa route at top, I mean the route except every params
- [Vuejs]-Vue props passing from parent component to child
- [Vuejs]-How to hide navbar when collapsed in bootstrap-vue
0👍
The issue was nothing to do with the routes it was that I was not returning a json response after the delete which was causing the issue
- [Vuejs]-Data not updating from Event Bus
- [Vuejs]-…mapActions in Vue-TypeScript application cause error
0👍
Try this way-
routes routes/api.php
Route::apiResource('event','EventController');
In Controller Method
public function destroy(Event $event)
{
$event->delete();
return new EventResource($event);
}
In Your Components
axios.delete('/api/event/'+this.data.module.slug)
.then(response => {
console.log(response)
this.$snotify.success("Data Successfully Delete",'Success')
})
.catch(err => {
console.log(err)
})
Source:stackexchange.com