Skip to content

Instantly share code, notes, and snippets.

@diaraujo13
Created October 5, 2020 03:58
Show Gist options
  • Save diaraujo13/9eabc877b8382eee2793180f5f76c40f to your computer and use it in GitHub Desktop.
Save diaraujo13/9eabc877b8382eee2793180f5f76c40f to your computer and use it in GitHub Desktop.
Laravel jGrowl
//No Controller
return redirect()->back()->with([
'message' => "Favor preencha todos os CAMPOS!"
]);
//No template
@if(Session::has('message'))
<script>
$(function () {
$.jGrowl("{{ Session::get('message') }}", {
position: 'bottom-center',
header: 'Wooopsss ⚠️',
theme: 'bg-warning',
});
});
</script>
@endif
// no HTML
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.4.7/jquery.jgrowl.css" integrity="sha512-bJUzQNnX8ns5wfU5evv67e9ILktl3dr6xQlwWUhB743gV5dZgOOvhnTg7l8LH/8noxBLctysfkz2e9nH5QDg+g==" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.4.7/jquery.jgrowl.min.js" integrity="sha512-h77yzL/LvCeAE601Z5RzkoG7dJdiv4KsNkZ9Urf1gokYxOqtt2RVKb8sNQEKqllZbced82QB7+qiDAmRwxVWLQ==" crossorigin="anonymous"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment