Skip to content

Instantly share code, notes, and snippets.

@dam1r89
Created April 3, 2017 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dam1r89/e53c4dfbc48af187e7e0d89275926636 to your computer and use it in GitHub Desktop.
Save dam1r89/e53c4dfbc48af187e7e0d89275926636 to your computer and use it in GitHub Desktop.
<script id="sweetMessages" type="application/json">{!! json_encode(array_only(session()->all(), ['success', 'error', 'warning'])) !!}</script>
<script>
var sweetMessages = JSON.parse($('#sweetMessages').html());
setTimeout(function () {
Object.keys(sweetMessages).forEach(function (key) {
return swal(sweetMessages[key], '', key);
});
}, 0);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment