Files
expense/resources/views/backend/layouts/partials/messages.blade.php
T

44 lines
1.2 KiB
PHP
Raw Normal View History

2024-12-02 01:18:34 +07:00
@if ($errors->any())
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<div>
@foreach ($errors->all() as $error)
<p>{{ $error }}</p>
@endforeach
</div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
@endif
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
2024-12-02 01:18:34 +07:00
@if (Session::has('success'))
<script>
Swal.fire({
title: "Success!",
text: "{{ Session::get('success') }}",
icon: "success"
2024-12-26 12:19:06 +07:00
}).then(() => {
if ("{{ Session::get('redirect_url') }}") {
window.location.href = "{{ Session::get('redirect_url') }}";
}
2024-12-02 01:18:34 +07:00
});
</script>
@endif
@if (Session::has('error'))
<script>
Swal.fire({
title: "Error!",
text: "{{ Session::get('error') }}",
icon: "error",
timer: 5000
2024-12-26 12:19:06 +07:00
}).then(() => {
if ("{{ Session::get('redirect_url') }}") {
window.location.href = "{{ Session::get('redirect_url') }}";
}
2024-12-02 01:18:34 +07:00
});
</script>
@endif