Home

Awesome

Alert Box (Laravel)

A helper package to flash a bootstrap alert to the browser via a Facade or a helper function.

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

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

OR

composer require bpocallaghan/alert

Usage

Within any view file.

@include('alert::alert')

Within any Controller.

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:

The different arguments:

If you need to modify the view partial, you can run:

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

The view partial can be found here resources\views\vendor\alert\alert.blade.

My other Packages