[Vuejs]-Axios delete route not supported laravel vuejs

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

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

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)
          })

Leave a comment