mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 10:21:37 +00:00
18 lines
667 B
PHP
18 lines
667 B
PHP
<div id="toast" hx-swap-oob="true">
|
|
<script>
|
|
window.addEventListener('toast', (e) => {
|
|
window.toastr[e.detail.type](e.detail.message);
|
|
});
|
|
</script>
|
|
@if (session()->has("toast.type") && session()->has("toast.message"))
|
|
<script defer>
|
|
if (window.toastr) {
|
|
window.toastr['{{ session()->get("toast.type") }}']('{{ session()->get("toast.message") }}');
|
|
}
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
window.toastr['{{ session()->get("toast.type") }}']('{{ session()->get("toast.message") }}');
|
|
});
|
|
</script>
|
|
@endif
|
|
</div>
|