xutl / laravel-notify
This is a Laravel flash notify message.
Installs: 46
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:HTML
Requires
- laravel/framework: 5.6.* | 5.5.* | 5.4.* | 5.3.* | 5.2.* | 5.1.* | 5.0.*
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-11-11 03:06:03 UTC
README
A simple package for flashing messages to views in Laravel 5+.
Installation
First, require the package using composer like so:
composer require xutl/laravel-notify
Add the service provider and alias in the app.php file in Laravel.
'providers' => [ ... XuTL\Notify\FlashNotifyServerProvider::class, ], ... 'aliases' => [ ... 'Notify' => XuTL\Notify\Notify::class, ],
Usage
To use Notify, simple add use Notify at the top of your php file and then call it using the Notify facade.
Notify::info('This is an info message'); Notify::success('This is a success message'); Notify::warning('This is a warning message'); Notify::error('This is an error message');
You can also add a title to the message if you would like:
Notify::error($message, $title); // By default, the $title variable is set to null. Notify::error('Something is broken', 'ERROR MESSAGE');