An open API service indexing awesome lists of open source software.

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+.

Awesome Lists containing this project

README

        

# laravel-notify

A simple package for flashing messages to views in Laravel 5+.

[![License](https://poser.pugx.org/xutl/laravel-notify/license.svg)](https://packagist.org/packages/xutl/laravel-notify)
[![Latest Stable Version](https://poser.pugx.org/xutl/laravel-notify/v/stable.png)](https://packagist.org/packages/xutl/laravel-notify)
[![Total Downloads](https://poser.pugx.org/xutl/laravel-notify/downloads.png)](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');
```