Package Data | |
---|---|
Maintainer Username: | lloople |
Maintainer Contact: | d.lloople@gmail.com (Lloople) |
Package Create Date: | 2017-04-11 |
Package Last Update: | 2018-02-08 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-05-04 03:03:10 |
Package Statistics | |
---|---|
Total Downloads: | 147 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 1 |
Total Forks: | 2 |
Total Open Issues: | 0 |
Simple session flashing messages manager for Laravel
Notifications are stored in Laravel's session flash input, keyed by notifications
Notificator::success('This is a success notification');
You can choose between 4 types
success
info
error
warning
@foreach(Notificator::all() as $notification)
<div class="alert alert-{{ $notification->getBootstrapClass() }}>
<p>{{ $notification->getMessage() }}</p>
</div>
@endforeach
getBootstrapType()
transforms the error
type into danger
to use it with Bootstrap default CSS alerts.
If you're not using Bootstrap, you can use getType
to get it as error
.
If you just want the first notification or you know you'll work with just one, you can use
Notificator::first()->getMessage();
Notification's Messages also have an integer $duration
in case you use a javscript library like toastr.js
You can modify the default duration of 5 seconds when creating the notification
Notificator::success('Message', 10000); // 10 seconds