https://github.com/ipunkt/laravel-notifications
Notifications package for laravel 4.x
https://github.com/ipunkt/laravel-notifications
Last synced: 4 months ago
JSON representation
Notifications package for laravel 4.x
- Host: GitHub
- URL: https://github.com/ipunkt/laravel-notifications
- Owner: ipunkt
- License: mit
- Created: 2014-06-07T06:36:45.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-01-14T19:55:08.000Z (over 11 years ago)
- Last Synced: 2025-05-08T23:09:03.592Z (about 1 year ago)
- Language: PHP
- Size: 171 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Notification package for Laravel 4.x
[](https://packagist.org/packages/ipunkt/laravel-notifications) [](https://packagist.org/packages/ipunkt/laravel-notifications) [](https://packagist.org/packages/ipunkt/laravel-notifications) [](https://packagist.org/packages/ipunkt/laravel-notifications)
Thanks to Jeffrey Way (https://laracasts.com/lessons/flexible-flash-messages)
## Installation
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`.
## Usage
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
## Credits
All credits goes to Jeffrey Way and .
We add translations for views, translating message string and split various templates as package content.