Skip to content

Instantly share code, notes, and snippets.

@MwirabuaTimothy
Created September 30, 2015 12:22
Show Gist options
  • Save MwirabuaTimothy/f1acfc3c0221229c312f to your computer and use it in GitHub Desktop.
Save MwirabuaTimothy/f1acfc3c0221229c312f to your computer and use it in GitHub Desktop.
Laravel 5 Blade Partial template for displaying ToastrJS notifications - @include('partials.toastr')
@if(session('toastr'))
<link rel="stylesheet" href="{{ asset('/plugins/toastr/toastr.min.css') }}">
<script src="{{ asset('/plugins/toastr/toastr.min.js') }}" type="text/javascript"></script>
<style type="text/css" media="screen">
.toast-top-right {
top: 50px;
}
</style>
<script>
$(document).ready(function() {
toastr.options.timeOut = 5000;
toastr.options.extendedTimeOut = 5000;
toastr.{{ session()->remove('toastr.level') }}
("{!! session()->remove('toastr.message') !!}");
});
</script>
@endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment