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

1.2.1 2020-08-29 08:41 UTC

This package is auto-updated.

Last update: 2021-01-29 09:26:10 UTC


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

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


First, pull in the package through Composer.

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


composer require bpocallaghan/alert

Include the service provider within config\app.php.

'providers' => [

Add a facade alias or use the globel helper function alert().

'aliases' => [
	'Alert' => Bpocallaghan\Alert\Facades\Alert::class,


Within any view file.


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:

  • alert()->info('Title', 'Lorem Ipsum');
  • alert()->success('Title', 'Lorem Ipsum');
  • alert()->warning('Title', 'Lorem Ipsum');
  • alert()->danger('Title', 'Lorem Ipsum');

The different arguments:

  • alert()->info('Title', 'Lorem Ipsum', false); // without the icon
  • alert()->info('Title', 'Lorem Ipsum', 'smile-o'); // specify the icon class
  • alert()->message('Title', 'Lorem Ipsum', 'smile-o', 'info'); // specify the type of level
  • alert()->message('Title', 'Lorem Ipsum', 'smile-o', 'info', false); // do not show the 'close' button

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.


  • Add an autohide / timeout option

Tank you


Please keep in mind this is for my personal workflow and might not help you. I developed this to help speed up my day to day workflow. Thank you for understanding.

My other Packages