Download the PHP package dongrim/laravel-toastr without Composer
On this page you can find all versions of the php package dongrim/laravel-toastr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dongrim/laravel-toastr
More information about dongrim/laravel-toastr
Files in dongrim/laravel-toastr
Package laravel-toastr
Short Description Toast notifications for laravel 5.5+, 6 and 7
License MIT
Informations about the package laravel-toastr
Toastr notifications for laravel 5.5+, 6 and 7
- Instalation
- Usage
- Tanks
- Tutorial video
Installation
1) Install the Toastr library (front end dependency)
1.1) Install Toastr via npm . Github | Demo
1.2) Require the js in resources/assets/js/bootstrap.js as window.toastr = require('toastr');
1.3) Import the sass in resources/assets/sass/app.scss as @import "~toastr/toastr";
then build via npm npm run prod
.
2) Install dongrim/laravel-toastr
2.1) Run
2.2) Optional: Laravel 5.4 and below
Add Dongrim\Toastr\ToastrServiceProvider::class
to providers
in config/app.php
.
Add 'Toastr' => Dongrim\Toastr\Facades\Toastr::class
to aliases
in config/app.php
.
2.3) Run php artisan vendor:publish --provider="Dongrim\Toastr\ToastrServiceProvider"
to publish the config file in config/toastr.php
2.4) Add {!! Toastr::render() !!}
Facade or {!! toastr()->render() !!}
helper in your main view.
2.4) Get all messages {!! Toastr::messages() !!}
Facade or {!! toastr()->messages() !!}
2.5) Optional: Modify the publish configuration file locate at config/toastr.php
to your liking.
Usage
Use the Toastr facade Toastr::
or the helper function toast()->
to access the methods in this package.
Examples:
You can also chain multiple messages together using:
Note that in the 3rd parameter
you can customize toastr options
. See the config/toastr.php
file for all possibilities.
All methods