Download the PHP package artdarek/toastr without Composer
On this page you can find all versions of the php package artdarek/toastr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download artdarek/toastr
More information about artdarek/toastr
Files in artdarek/toastr
Package toastr
Short Description Toastr - Flash Messages for Laravel 5
License MIT
Homepage https://github.com/artdarek/toastr
Informations about the package toastr
Toastr - Flash Messages for Laravel 5
Simple flash messagges system to use with Laravel 5 Framework. By default it relies on twitter bootstrap "alert" component. You can display multiple flash messages in different types (success, info, warning, danger) at once and to each message you can asign some custom params that will allow you for example mark some of them as important etc.
- Installation
- Registering the Package
- Usage
Installation
Via composer require command
Use composer require command to install this package.
Laravel version Compatibility
Laravel | Package |
---|---|
5.0.x | 1.0.x |
5.1.x | 1.0.x |
5.2.x | 2.0.x |
5.3.x | 2.0.x |
5.4.x | 2.0.x |
Adding package to composer.json file manually
Add package to your composer.json file:
Use composer update command to install this package.
Registering the Package
Add the Toastr Service Provider to your config in config/app.php
:
and create an alias:
Usage
First of all you need to add some code to your view scripts. In most cases it will be layout file (or other place where you want to flash message be displayed). You can use default view script distrubuted within this package by adding following code into your view file:
or to gain more controll of the look and feel of your flash messages you can start with using following template (just copy and paste it into a place where your application allerts should be displayed):
In your controllers/action before you perform a redirect:
you can push more than one alert at once:
Other usage examples: