<script>
        forms= document.querySelectorAll('.delete-form');

        forms.forEach(form => {
            form.addEventListener('submit',(e)=>{
                e.preventDefault();

                Swal.fire({
                    title: "Eliminar registro",
                    text: "estas seguro?",
                    icon: "warning",
                    showCancelButton: true,
                    confirmButtonText: "Eliminar",
                    cancelButtonText: "regresar",
                    }).then((result) => {
                    if (result.isConfirmed) {
                        form.submit();
                    }
                    });
            });
        });
    </script>

    @if(session('swal'))
        <script>
            Swal.fire(@json(session('swal')))
        </script>
    @endif
