kesty/laravel-notifier

Simple notification widget for Laravel ^8.0, ^9.0, ^10.0, ^11.0

3.0.3 2024-10-31 21:33 UTC

This package is auto-updated.

Last update: 2024-12-01 00:09:02 UTC


README

Notification system for laravel ^7.* : ^8.* : ^9.* : ^10.0 : ^11.0

Version 3.0 supports icon, image, layout and theme

Installation

First, pull in the package through Composer.

composer require kesty/laravel-notifier

And then include the service provider within app/config/app.php. (Skip this step if you are on Laravel 7.5 or above)

'providers' => [
    Kesty\LaravelNotifier\NotifierServiceProvider::class
];

At last you need to publish configs and assets.

php artisan vendor:publish --provider="Kesty\LaravelNotifier\ServiceProvider"

Setup

Insert the following after the opening of tag of your HTML For default bootstrap alert dev, use the following

@include('vendor.laravel-notifier.messages')

For Kesty Notify, use the following

@include('vendor.laravel-notifier.notify')

Controller Usage

// call the facade class
KestyNotify::info(title, body);
// or as function
kNotifier('Welcome to Laravel', 'Laravel', 'success');
kNotifier()->message('Welcome to Laravel', 'Laravel', 'info');

Test the beautiful custom version like so

kNotifier()->message('Welcome to Laravel', 'Great', null, 'fa-solid fa-check', '/assets/images/avatar.jpg', 'dark', 2);

Ensure you have an avatar image and font-awesome icon is loaded. You can use any icon of your choice, just check the icon argument to any icon you installed in your project.

You can modify /laravel-notifier/*.css to suit your needs. it's a basic iziToast styles.