https://github.com/starcodekh/alert-imessage
Alert message custom on bootstrap 5.3
https://github.com/starcodekh/alert-imessage
Last synced: 2 months ago
JSON representation
Alert message custom on bootstrap 5.3
- Host: GitHub
- URL: https://github.com/starcodekh/alert-imessage
- Owner: StarCodeKh
- Created: 2025-03-08T04:45:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-08T04:58:59.000Z (over 1 year ago)
- Last Synced: 2025-03-08T05:25:36.318Z (over 1 year ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# alert-imessage
Alert message custom on bootstrap 5.3
# Example calls JS
// imessage.show("Default Success!", "success");
// imessage.show("Top Center Message!", "info", "top-center");
// imessage.show("Bottom Right Warning!", "warning", "bottom-right");
// imessage.show("Bottom Left Error!", "fail", "bottom-left");
// imessage.show("Centered Notification!", "info", "center");
# Example calls in Laravel
return redirect()->back()->with('success', 'Default Success!');
return redirect()->back()->with('error', 'Default Error!');
return redirect()->back()->with('info', 'Default Info!');
return rredirect()->back()->with('warning', 'Default Warning!');
# Example calls in Laravel on main page
document.addEventListener("DOMContentLoaded", function () {
let messages = {
success: "{{ session('success') }}",
error: "{{ session('error') }}",
warning: "{{ session('warning') }}",
info: "{{ session('info') }}"
};
Object.keys(messages).forEach(type => {
if (messages[type]) {
new Message('imessage').show(messages[type], type === "error" ? "fail" : type, "top-center");
}
});
});