-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtoastr.php
49 lines (31 loc) · 1.01 KB
/
toastr.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
<!-- header link -->
<!-- footer link -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<script>
@if (Session::has('message'))
var type = ("{{ Session::get('type') }}");
var message = ("{{ Session::get('message') }}");
switch (type) {
case 'success':
toastr.success(message);
break;
case 'warning':
toastr.warning(message);
break;
case 'error':
toastr.error(message);
break;
case 'info':
toastr.info(message);
break;
}
@endif
</script>
<!-- Controller code -->
<?php
$success = [
'type' => 'success',
'message'=>'Profile Updated Successfully',
];
return redirect()->route('profile')->with($success);