Skip to content

Commit 09d7556

Browse files
Add files via upload
1 parent f7d2cf0 commit 09d7556

File tree

5 files changed

+87
-0
lines changed

5 files changed

+87
-0
lines changed

components/delete.blade.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{-- <a href="javascript:void();" onclick="delete_action({{ route('user.delete',$user->id) }})"></a> --}}
2+
3+
<form action="" method="POST" id="delete-form" style="display: none">
4+
@csrf
5+
@method('Delete')
6+
</form>

js/delete.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
function delete_action(url) {
2+
Swal.fire({
3+
title: "Are you sure?",
4+
text: "You won't be able to revert this!",
5+
type: "warning",
6+
showCancelButton: true,
7+
confirmButtonColor: "#3085d6",
8+
cancelButtonColor: "#d33",
9+
confirmButtonText: "Yes, delete it!",
10+
confirmButtonClass: "btn btn-primary",
11+
cancelButtonClass: "btn btn-danger ml-1",
12+
buttonsStyling: false,
13+
}).then(function (result) {
14+
if (result.value) {
15+
$("#delete-form").attr("action", url).submit();
16+
Swal.fire({
17+
type: "success",
18+
title: "Deleted!",
19+
text: "Your file has been deleted.",
20+
confirmButtonClass: "btn btn-success",
21+
});
22+
}
23+
});
24+
}

plugins/sweet-alert2/sweetalert2.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/sweet-alert2/sweetalert2.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readme.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## About <a href="javascript:void();" target="_blank">Laravel Delete Sweet Alert Popup Components</a>
2+
3+
Delete Sweet Alert Popup Components For Laravel Project
4+
5+
## Doc:
6+
7+
<hr/>
8+
9+
- first copy plugins and js folder then paste it on public folder
10+
11+
- Then Link those Js and css file to your layouts/app.blade
12+
13+
- For Css
14+
```
15+
<link rel="stylesheet" href="{{ asset('plugins/sweet-alert2/sweetalert2.min.css') }}">
16+
```
17+
- For Js
18+
```
19+
<script src="{{asset('plugins/sweet-alert2/sweetalert2.min.js')}}"></script>
20+
<script src="{{asset('js/delete.js')}}"></script>
21+
22+
```
23+
24+
- then copy components/delete.blade.php and paste it on resource/views/components folder.
25+
26+
- For use This Componet use those Line to your file
27+
28+
```
29+
<a href="javascript:void();" onclick="delete_action({{ route('user.delete',$user->id) }})"></a>
30+
```
31+
32+
```
33+
{{-- call It for once time --}}
34+
<x-delete>
35+
```
36+
37+
```
38+
39+
## <a href="https://iqbalhasan.dev" target="_blank">iqbalhasan.dev</a> Sponsors
40+
41+
We would like to extend our thanks to the following sponsors for funding <a href="https://iqbalhasan.dev" target="_blank">iqbalhasan.dev</a> development. If you are interested in becoming a sponsor, please email us <a href="mailto:info@iqbalhasan.dev">info@iqbalhasan.dev</a>
42+
43+
## Security Vulnerabilities
44+
45+
If you discover a security vulnerability within Laravel, please send an e-mail to <a href="https://iqbalhasan.dev" target="_blank">IQBAL HASAN</a> via [info@iqbalhasan.dev](mailto:info@iqbalhasan.dev). All security vulnerabilities will be promptly addressed.
46+
47+
## License
48+
49+
The iqbalhasan.dev Project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
50+
51+
```
52+
53+
```
54+
55+
```

0 commit comments

Comments
 (0)