Skip to content

ipunkt/laravel-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notification package for Laravel 4.x

Latest Stable Version Latest Unstable Version License Total Downloads

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 https://laracasts.com. We add translations for views, translating message string and split various templates as package content.

About

Notifications package for laravel 4.x

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages