Created
December 18, 2020 13:17
-
-
Save dwaard/2051000c03c0130b94ad63883128d176 to your computer and use it in GitHub Desktop.
Bulma components for standard Laravel messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if (session('status')) {{-- status messages are for auth and password messages --}} | |
<div class="notification is-success"> | |
<button class="delete"></button> | |
{{ session('status') }} | |
</div> | |
@endif | |
@if(session('info')) | |
<div class="notification is-info"> | |
<button class="delete"></button> | |
{{ session('info') }} | |
</div> | |
@endif | |
@if(session('success')) | |
<div class="notification is-success"> | |
<button class="delete"></button> | |
{{ session('success') }} | |
</div> | |
@endif | |
@if(session('warning')) | |
<div class="notification is-warning"> | |
<button class="delete"></button> | |
{{ session('warning') }} | |
</div> | |
@endif | |
@if(session('danger')) | |
<div class="notification is-danger"> | |
<button class="delete"></button> | |
{{ session('danger') }} | |
</div> | |
@endif | |
@push('scripts') | |
<script type="application/javascript"> | |
document.addEventListener('DOMContentLoaded', () => { | |
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => { | |
$notification = $delete.parentNode; | |
$delete.addEventListener('click', () => { | |
$notification.parentNode.removeChild($notification); | |
}); | |
}); | |
}); | |
</script> | |
@endpush |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment