Laravel notification alert using bootstrap notify plugin example (ok)
https://www.itsolutionstuff.com/post/laravel-5-notification-alert-using-bootstrap-notify-plugin-exampleexample.html
C:\xampp\htdocs\reset\routes\web.php
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
use App\Http\Controllers\HomeController;
use App\Http\Controllers\ItemController;
Route::get('/', function () {
dd('Welcome to simple user route file.');
});
Auth::routes();
Route::get('/home', [HomeController::class, 'index'])->name('home');
Route::get('notification', [HomeController::class,'notification']);C:\xampp\htdocs\reset\app\Http\Controllers\HomeController.php
C:\xampp\htdocs\reset\resources\views\notification-check.blade.php
C:\xampp\htdocs\reset\resources\views\notification.blade.php
Laravel notification alert using bootstrap notify plugin example
By Hardik Savani March 11, 2017 Category : PHP Laravel Bootstrap jQueryWe always require to notification alert after some action like if you remove items then notification popup will open with message like "Item removed successfully", same as on every action like create, update, listing or others. As specially we are working on admin panel, it's mandatory.
So, i would like show you how to add bootstrap notify js plugin notification popup in laravel 5, laravel 6, laravel 7, laravel 8 and laravel 9 from scratch. bootstrap notify plugin provide us success message notification, info message notification, warning message notification, error message notification that way we can add notification with good layout using bootstrap framework.
Laravel have also several package for notification but i use bootstrap notify js plugin, that is integrate with bootstrap. I also several posted for notification alert as listed bellow:
Laravel notification message popup using toastr js plugin
Bootstrap notification popup box example using bootstrap-growl JS plugin with demo
Laravel 5 - Implement Flash Messages with example
Ok, now we are ready to implement bootstrap notify for flash message from scratch, so you have to just follow following few thing.
First we will add new route for testing bootstrap notify notification like as bellow:
routes/web.php
Ok, now we require to add controller method, so if you haven't HomeController then create new HomeController and add code as bellow:
app/Http/Controllers/HomeController.php
Next, we require to create notification-check.blade.php file for layout so create new notification-check.blade.php file in resources directory.
resources/views/notification-check.blade.php
At last we require to create notification.blade.php file for display bootstrap notify notification. this file we can include in our default file that way we don't require to write same code in all place.
So, first let's create notification.blade.php and put bellow code on that file.
resources/views/notification.blade.php
Now we are ready to run our example so run bellow command for quick run:
Now you can open bellow URL on your browser:
you can get more demo from here : Click Here.
We see example only for success, but you can also generate notification alert of info, error, warning like as bellow session variable:
Info:
Warning:
Error:
Read Also: Laravel notification alert using bootstrap notify plugin example
I hope it can help you...
Last updated
Was this helpful?