Open Ameen10100 opened 1 year ago
This can be achieved by adding this code snippet after <x-notifications/>
in your main template. If someone can contribute this code snippet to the
<x-notifications position="top-center"
z-index="z-[100]"/>
@foreach ($errors->all() as $error)
<script>
document.addEventListener("DOMContentLoaded", () => {
window.$wireui.notify({title: '{{ $error }}', icon: 'error'});
});
</script>
@endforeach
@if (session('success'))
<script>
document.addEventListener("DOMContentLoaded", () => {
window.$wireui.notify({title: '{{ session('success') }}', icon: 'success'});
});
</script>
@endif
</body>
</html>
I have the same issue, tried the code above but the notification is not trigger. One thing that works is with the wireui hooks
` @if (session('success'))
@endif
`
but the problem is even though the session is already missing the notification is still showing after click back to the the destination page @Ameen10100 @ibnIrshad @PH7-Jack
If it's possible to add the feature where you can pass the notification to a redirect like the one displayed by livewire using session flash in this link https://laravel-livewire.com/docs/2.x/flash-messages