2017 © Pedro Peláez
 

library alert

A helper package to flash a bootstrap alert to the browser.

image

bpocallaghan/alert

A helper package to flash a bootstrap alert to the browser.

  • Tuesday, February 20, 2018
  • by bpocallaghan
  • Repository
  • 3 Watchers
  • 11 Stars
  • 1,587 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 4 Versions
  • 15 % Grown

The README.md

Alert Box (Laravel)

A helper package to flash a bootstrap alert to the browser via a Facade or a helper function., (*1)

<div class="alert alert-info fade in">
    <i class="fa-fw fa fa-smile-o"></i>
    <strong>Title</strong> Description
</div>

Want to see the current package in action, have a look at my starter project.

Laravel Starter Project

Installation

First, pull in the package through Composer., (*2)

"require": {
    "bpocallaghan/alert": "1.*"
}

OR, (*3)

composer require bpocallaghan/alert

Usage

Within any view file., (*4)

@include('alert::alert')

Within any Controller., (*5)

public function index()
{
    // helper function - default to the 'info'
    alert('Title', 'Lorem Ipsum');

    // return object first
    alert()->info('Title', 'Lorem Ipsum');

    // via the facade
    Alert::info('Title', 'Lorem Ipsum');

    return view('home');
}

The different 'levels' are: - alert()->info('Title', 'Lorem Ipsum'); - alert()->success('Title', 'Lorem Ipsum'); - alert()->warning('Title', 'Lorem Ipsum'); - alert()->danger('Title', 'Lorem Ipsum');, (*6)

The different arguments: - alert()->info('Title', 'Lorem Ipsum', false); // without the icon - alert()->info('Title', 'Lorem Ipsum', 'smile-o'); // specify the icon class - alert()->info('Title', 'Lorem Ipsum', 'smile-o', true); // limit alert to the request lifecycle - alert()->message('Title', 'Lorem Ipsum', 'smile-o', true, 'info'); // specify the type of level - alert()->message('Title', 'Lorem Ipsum', 'smile-o', true, 'info', false); // do not show the 'close', (*7)

If you need to modify the view partial, you can run:, (*8)

php artisan vendor:publish --provider="Bpocallaghan\Alert\AlertServiceProvider"

The view partial can be found here resources\views\vendor\alert\alert.blade., (*9)

My other Packages

The Versions

20/02 2018

dev-master

9999999-dev

A helper package to flash a bootstrap alert to the browser.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

laravel message notification alert flash

08/10 2017

1.1.1

1.1.1.0

A helper package to flash a bootstrap alert to the browser.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

laravel message notification alert flash

19/09 2017

1.1.0

1.1.0.0

A helper package to flash a bootstrap alert to the browser.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

laravel message notification alert flash

01/04 2016

1.0.1

1.0.1.0

A helper package to flash a bootstrap alert to the browser.

  Sources   Download

MIT

The Requires

  • php >=5.5.9