| Package Data | |
|---|---|
| Maintainer Username: | rokde |
| Maintainer Contact: | rok@ipunkt.biz (Robert Kummer) |
| Package Create Date: | 2014-06-07 |
| Package Last Update: | 2015-01-14 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-30 03:16:44 |
| Package Statistics | |
|---|---|
| Total Downloads: | 372 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 2 |
| Total Watchers: | 4 |
| Total Forks: | 2 |
| Total Open Issues: | 0 |
Thanks to Jeffrey Way (https://laracasts.com/lessons/flexible-flash-messages)
Add to your composer.json following lines
"require": {
"ipunkt/laravel-notifications": "~2.*"
}
Add 'Ipunkt\LaravelNotifications\NotificationsServiceProvider', to providers in app/config/app.php.
Add 'Flash' => 'Ipunkt\LaravelNotifications\NotificationsFacade', to aliases in app/config/app.php.
In controller action use following statement to make a flash notification:
// flashing an info message
Flash::message('Welcome');
// flashing an info message
Flash::info('Welcome');
// flashing a success message
Flash::success('Welcome');
// flashing an error message
Flash::error('Welcome');
// flashing an overlaying message
Flash::overlay('Welcome');
You can also use translatable messages:
Flash::message('app.errors.input_invalid');
In your view or layout template (e.g. a blade template) include the view of your choice:
@include('laravel-notifications::bootstrap-3/flash')
You can publish the views and modify it to your needs (optional):
$> php artisan view:publish ipunkt/laravel-notifications
All credits goes to Jeffrey Way and https://laracasts.com. We add translations for views, translating message string and split various templates as package content.