Hello,
I have a Laravel application with several basic RESTful resources (index, create, store, show, edit, update, destroy).
So I have blade templates for each resource and for each action (index, create, show, edit).
In each "show" template, I currently have a delete button, opening a regular Bootstrap modal window (so based on jQuery), which contains a "confirm" button that sends the form with delete method to the controller.
The thing is I have this same modal window (about 20 lines) for each of the resource.
Since I've included VueJs for other things in the application, I would like to get rid these repetitions by using a "modal delete confirmation" component. I actually included BootstrapVue too which has ready-to-use modal components: https://bootstrap-vue.js.org/docs/components/modal/
But what I don't see, is how to send the html form / http delete method (with a different route for each resource) using the VueJs modal component.
Should the component be modified to send the route as parameter, and then using axios inside the component to send the request?
Or should I catch the event from blade template and then send the form?
In knowing I'm using Laravel Mix so I'm not supposed to write JS directly within the blade template.
I would have expected a simple solution as with regular Bootstrap with jQuery, but I guess I'm missing some basic principles of VueJs here...
Thank you for any help!