Created
September 6, 2017 12:28
-
-
Save selabie68/25aa7d71b164640dde409697c162203e to your computer and use it in GitHub Desktop.
Laravel Flash (laracast/flash) MaterializeCSS Template
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
@foreach (session('flash_notification', collect())->toArray() as $message) | |
@if ($message['overlay']) | |
@include('partials.materialise.modal', [ | |
'modalClass' => 'flash-modal', | |
'title' => $message['title'], | |
'body' => $message['message'] | |
]) | |
@else | |
@if($message['level'] === 'danger') | |
<div class="error-panel card-panel red lighten-2"> | |
<p class="white-text">{{ $message['message'] }}</p> | |
</div> | |
@elseif($message['level'] === 'success') | |
<div class="card-panel green lighten-2 white-text"> | |
<i class="material-icons">check</i> | |
{{ $message['message'] }} | |
</div> | |
@else | |
<div class="card-panel blue lighten-3"> | |
<i class="material-icons">info</i> | |
{{ $message['message'] }} | |
</div> | |
@endif | |
@endif | |
@endforeach | |
{{ session()->forget('flash_notification') }} |
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
<div id="flash-overlay-modal" class="modal {{ $modalClass or '' }}"> | |
<div class="modal-content"> | |
<h4>{{ $title }}</h4> | |
<p>{!! $body !!}</p> | |
</div> | |
<div class="modal-footer"> | |
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">Ok</a> | |
</div> | |
</div> | |
@push('scripts') | |
<script> | |
$(document).ready(function () { | |
$("#flash-overlay-modal").modal(); | |
$("#flash-overlay-modal").modal('open'); | |
}); | |
</script> | |
@endpush |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment