Last active
July 30, 2018 09:54
-
-
Save fridzema/d8998b5dfaed82a8a71ef8c7201b03dd to your computer and use it in GitHub Desktop.
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(!is_null(session('flash_notification'))) | |
@foreach ((array)session('flash_notification') as $message) | |
@php $message = (array)$message[0]; @endphp | |
@javascript([ | |
'Message' => $message | |
]) | |
<script> | |
toastr.options.closeButton = true; | |
toastr.options.progressBar = true; | |
toastr.options.timeOut = 2000; | |
if(Message.level == "success"){ | |
toastr.success(Message.message); | |
} | |
if(Message.level == "info"){ | |
toastr.info(Message.message); | |
} | |
if(Message.level == "warning"){ | |
toastr.warning(Message.message); | |
} | |
if(Message.level == "danger"){ | |
toastr.error(Message.message); | |
} | |
</script> | |
@endforeach | |
{{ session()->forget('flash_notification') }} | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment