coderatio/laranotify
Advanced Laravel notifications/alerts built on Bootstrap Notify/Growl. Chain fluent methods to show elegant on-screen messages, blockables, and notifications, with template customization and publishable sample views.
Laranotify is the most advanced and recommended laravel package that redefines the way alert messages or notifications are displayed on screen.
It's built on top of the popular Bootstrap notify plugin by Robert McIntosh. Every method found there in the plugin is included in this awesome package. The package has added the ability to create custom templates apart from the type provided by Robert. However, customizing the template, gives your users different looks. Read about template customization under templates section.
Note: To start building your custom templates, it’s advisable to publish the samples provided by the package to your view directory. Learn more about this here
When published, the sample templates will be copied to
views/vendor/vendorfolder.
The package provider is auto-discovered if you are using Laravel 5.5 and above. If your version is less than 5.5, kindly add this line to your config/app.php file under providers array.
/**
* Laranotify provider.
*
*/
Coderatio\Laranotify\LaranotifyServiceProvider::class,
The package comes with two facades. If you want to use them, kindly the code below to your config/app.php file under aliases array.
/**
* Laranotify aliases.
*
*/
'Notify' => Coderatio\Laranotify\Facades\Notify::class,
'Laranotify' => Coderatio\Laranotify\Facades\Laranotify::class,
The package has configuration and assets files that needs to be published to your app public directory. To publish these files, run this on your terminal:
php artisan vendor:publish --tag=laranotify-required
Finally, call notify_header() function at the head tag and notify_footer() after your bootstrap JavaScript file to register laranotify assets in your project. This step is required.
e.g
notify_header();
Note: If you want to use the included Bootstrap css file, pass
trueas a parameter to the function like this:
notify_header(true);
notify_footer();
Note: If you want to use the included Bootstrap and jQuery files, pass
trueas a parameter to the function like this:
notify_footer(true);
Note: For these files to be properly loaded in your project, you will need to run this on your terminal:
php artisan vendor:publish --tag=laranotify-foundations
Notify::message ('I am a simple notification from laranotify');
// You've just created your first notification.
You can then chain other methods to it. For example, if i want to change the delay period, i will do this:
Notify::success('I am a simple notification from laranotify')->delay(6000);
// 6000 = 6secs.
We included two facades for conveniences. You can choose to use either of them.
There are two helper functions provided to help you get started out of the box. The helper functions return the instance of the package service class.
/**
* [@param](https://github.com/param) (string) $message
*/
notify();
This helper takes only one argument which is your message. You may use the message method or notify types methods e.g error, info e.t.c by chaining to the helper function and many other once.
/**
* [@param](https://github.com/param) (string) $message
*/
laranotify();
// Same as notify helper above. Take a look below.
notify('Hello World');
// OR
laranotify('Hello World');
Will display Hello World on screen with default bootstrap info alert type.
To display a different type of alert , say error alert, chain error method to a helper or type method and pass any bootstrap alert class or your custom class to it. E.g
notify()->error('There was an error!');
// OR
notify('There was an error!')->type('danger');
We deeply want to appreciate the creator of Bootstrap notify or growl plugin Robert McIntosh. Without which, there wouldn't have been this awesome package.
| head1 | head two | three |
|---|---|---|
| ok | good swedish fish | nice |
| out of stock | good and plenty | nice |
| ok | good oreos |
hmm |
| ok | good zoute drop |
yumm |
![]()

Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.
The final element.
How can I help you explore Laravel packages today?