Skip to content

Instantly share code, notes, and snippets.

View guilhermemuller's full-sized avatar

Guilherme Müller guilhermemuller

View GitHub Profile
@guilhermemuller
guilhermemuller / delete-form-creation.js
Created November 27, 2021 10:35
Laravel dynamic delete form creation
// This is a simple update of https://gist.github.com/JeffreyWay/5112282
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
window.addEventListener('DOMContentLoaded', (event) => {
(function() {