CDN Link
<script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.js"></script>
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css">Error message
$notification = array( 'message' => 'I am a successful message!', 'alert-type' => 'success' ); return Redirect::to('/')->with($notification);
Footer script
<script> @if(Session::has('message')) var type = "{{ Session::get('alert-type', 'info') }}"; switch(type){ case 'info': toastr.info("{{ Session::get('message') }}"); break; case 'warning': toastr.warning("{{ Session::get('message') }}"); break; case 'success': toastr.success("{{ Session::get('message') }}"); break; case 'error': toastr.error("{{ Session::get('message') }}"); break; } @endif </script>
Post a Comment