kesty / laravel-notifier
Simple notification widget for Laravel ^8.0, ^9.0, ^10.0, ^11.0
Installs: 77
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:CSS
Requires
- php: ^8.0|^8.1|^8.2
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
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.