https://github.com/xutl/laravel-notify
A simple package for flashing messages to views in Laravel 5+.
https://github.com/xutl/laravel-notify
laravel laravel-5-package laravel-package
Last synced: 2 months ago
JSON representation
A simple package for flashing messages to views in Laravel 5+.
- Host: GitHub
- URL: https://github.com/xutl/laravel-notify
- Owner: xutl
- Created: 2018-08-27T11:44:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-14T03:42:54.000Z (over 6 years ago)
- Last Synced: 2025-01-20T12:46:37.306Z (4 months ago)
- Topics: laravel, laravel-5-package, laravel-package
- Language: HTML
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# laravel-notify
A simple package for flashing messages to views in Laravel 5+.
[](https://packagist.org/packages/xutl/laravel-notify)
[](https://packagist.org/packages/xutl/laravel-notify)
[](https://packagist.org/packages/xutl/laravel-notify)## 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.
```php
'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.```php
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:
```php
Notify::error($message, $title); // By default, the $title variable is set to null.
Notify::error('Something is broken', 'ERROR MESSAGE');
```