Skip to content

Instantly share code, notes, and snippets.

@fer-ri
Created May 28, 2014 03:27
Show Gist options
  • Select an option

  • Save fer-ri/eca6f95b9e13a6f6f369 to your computer and use it in GitHub Desktop.

Select an option

Save fer-ri/eca6f95b9e13a6f6f369 to your computer and use it in GitHub Desktop.
Blade Template for Handle Flash Session Message In Laravel
@if ($errors->any())
<div class="alert alert-error alert-block">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<h4>Error</h4>
Please check the form below for errors
</div>
@endif
@if ($message = Session::get('success'))
<div class="alert alert-success alert-block">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<h4>Success</h4>
{{ $message }}
</div>
@endif
@if ($message = Session::get('error'))
<div class="alert alert-error alert-block">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<h4>Error</h4>
{{ $message }}
</div>
@endif
@if ($message = Session::get('warning'))
<div class="alert alert-warning alert-block">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<h4>Warning</h4>
{{ $message }}
</div>
@endif
@if ($message = Session::get('info'))
<div class="alert alert-info alert-block">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<h4>Info</h4>
{{ $message }}
</div>
@endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment