Download the PHP package taylornetwork/toastr without Composer
On this page you can find all versions of the php package taylornetwork/toastr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download taylornetwork/toastr
More information about taylornetwork/toastr
Files in taylornetwork/toastr
Package toastr
Short Description A laravel class that will generate Toastr messages using toastr.js
License
Informations about the package toastr
Toastr for Laravel
A simple facade for Laravel 5 to generate toastr message using toastr.js.
Install
Via Composer
Dependencies
You will need to include toastr.js
on your pages.
You can install using bower
or include from CDNjs.
This may not be the most up to date information, see CodeSeven/toastr
Setup
Provider Setup
Add the service provider to the providers array in your config/app.php
Facade Setup
Add the Toastr
facade to your aliases array in config/app.php
While this is optional, it is greatly recommended because Toastr::render()
will be used in your base view and is easier than having to include the Toastr
class.
Publishing Config
Will add config/toastr.php
to your project.
View Setup
You will need to include the toastr.js
and toastr.css
files from bower or CDNjs (see Dependencies section above) in your base views.
You will also need to add the following line after both files are included in order to render Toastr messages.
Usage
Include TaylorNetwork\Toastr\Facades\Toastr
in what ever class you plan on generating a Toastr message.
By default the styles available are success
, error
, info
, warning
. But you can remove any in config/toastr.php
TaylorNetwork\Toastr\Toastr
uses a magic method to generate toastr messages.
To generate a success message
Will push a success message to the session and will appear on the next request.
The magic method accepts a minimum of one parameter, the text you want to be displayed. The optional second parameter is the title of the message.
To add a custom title to the toastr message
Credits
- Main Author: Sam Taylor
License
The MIT License (MIT). Please see License File for more information.