Download the PHP package mujhtech/nav-toastr without Composer
On this page you can find all versions of the php package mujhtech/nav-toastr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mujhtech/nav-toastr
More information about mujhtech/nav-toastr
Files in mujhtech/nav-toastr
Package nav-toastr
Short Description nav-toastr flash notification with custom redirection for laravel app
License MIT
Informations about the package nav-toastr
NavToastr Notifications and Custom Redirection for Laravel App
:eyes: This package helps you to add Toast.js notifications to your Laravel app
Install
You can install the package using composer
Then add the service provider to config/app.php
. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.
To install the configuration and assets file run:
Usage:
Include [app.css] and app.js in your view template:
- Link to app.css
<link href="src/Toast.css" rel="stylesheet"/>
or@navtoastrCss
-
Link to app.js
<script src="src/Toast.js"></script>
or@navtoastrJs
- use
navtoastr()
helper function inside your controller to set a toast notification for info, success, warning or error
as an example:
After that add the @navtoastrRender
at the bottom of your view to actualy render the nav-toastr notifications.
Other Options
Other api methods:
// You can also chain multiple messages together using method chaining
// you could replace @navtoastrRender
by :
// you can use navtoastr('')
instead of navtoastr()->success()
so
navtoastr($message)
is equivalent tonavtoastr()->success($message)
navtoastr($message, 'info', true)
is equivalent tonavtoastr()->info($message, true)
navtoastr($message, 'warning', true)
is equivalent tonavtoastr()->warning($message, true)
navtoastr($message, 'error', false)
is equivalent tonavtoastr()->error($message, false)
configuration:
Credits
License
MIT