alex-oliveira/ao-alert

Resources for Alerts with Laravel 5.* + Bootstrap 3

1.0.1 2017-02-14 16:33 UTC

This package is auto-updated.

Last update: 2024-10-25 22:58:37 UTC


README

Resources for Alerts with Laravel 5.1 + Bootstrap 3

1) Installation

$ composer require alex-oliveira/ao-alert

2) config/app.php

'providers' => [
    /*
     * Vendors Service Providers...
     */
    AoAlert\AlertServiceProvider::class,
],
'aliases' => [
    /*
     * Vendors Facades...
     */
    'Alert' => AoAlert\AlertFacade::class,
],

3) Using

Showing alerts in your template or view.

{!! alert()->show() !!}

Add new messages in session.

alert()->info('message');
alert()->success('message');
alert()->warning('message');
alert()->danger('message');

Add multiple messages.

alert()->info(['message a', 'message b', 'message c']);

Add message with multiple topics.

alert()->danger('message', ['topic a', 'topic b', 'topic c']);

Add new custom messages in session.

/* CSS */
.alert-custom{
    background: #ccc
}

/* PHP */
alert()->add('alert-custom', 'message');