Last active
April 24, 2021 10:10
-
-
Save marvinhosea/52dd13a5263d6ac5f6856f1d984d50a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Blade | |
<form id="delete-company" action="{{ route('company.destroy', $company->id) }}" method="post"> | |
{{csrf_field()}} | |
{{method_field('delete')}} | |
<button type="button" class="btn btn-xs btn-primary" data-toggle="modal" data-target="#agent{{$company->id}}">Edit</button> | |
<button type="button" class="btn btn-danger btn-xs" onclick="confirmDelete('delete-company')">delete</button> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function confirmDelete(item_id) { | |
swal({ | |
title: "Are you sure?", | |
text: "Once deleted, you will not be able to recover it!", | |
icon: "warning", | |
buttons: true, | |
dangerMode: true, | |
}) | |
.then((willDelete) => { | |
if (willDelete) { | |
$('#'+item_id).submit(); | |
} else { | |
swal("Cancelled Successfully"); | |
} | |
}); | |
} | |
</script> |
vhgah
commented
Apr 24, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment