Created
October 5, 2020 03:58
-
-
Save diaraujo13/9eabc877b8382eee2793180f5f76c40f to your computer and use it in GitHub Desktop.
Laravel jGrowl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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