This Laravel tutorial helps to add notification functionality to Laravel 10. I am using flasher-laravel and with popular notification toaster library.
Toastr is an awesome JavaScript library that helps to display messages in the form of notifications, the message could be the type of info, success, warning, or error.
The only dependency is jQuery and flasher-laravel libs, it’s running into the top of the jQuery libs. I am using third-party laravel package to display message into the application.
This Laravel flasher package helps you to add notifications to your Laravel 10 project.
You can also check other recommended tutorials of Lumen/Laravel,
You can add flash messages to your Laravel or Symfony projects quickly and simply with PHPFlasher, a robust and user-friendly package. Flash messages are an easy and efficient way to give feedback to your users, whether you need to notify them of a successful form submission, an error, or any other important information.
PHPFlasher supports popular notification libraries : toastr.js, sweetalert 2, pnotify, noty, notyf and even show desktop notifications.
The other features are:
You can use it directly toaster.js
lib’s into Laravel application but that needs more configurations. The Laravel PHPFlasher package is easy to use and integrates with the Laravel application. This is a simple plug-and-play plugin.
Install the PHPFlasher package using composer.
composer require php-flasher/flasher-laravel
install the toaster adapter in our Laravel application.
$laravel_project> require php-flasher/flasher-toastr-laravel
Let’s call toaster method into the controller file.
namespace App\Controller; class AppController { public function save() { toastr()->addSuccess('Your account has been restored.'); } }
You can also set the value true
into the closeButton()
method, a close button is displayed in the toast notification.
toastr() ->closeButton(true) ->addWarning('Your password may be at risk.');
This tutorial helps integrate a PHP SDK with Laravel. We'll install aws-php-sdk into laravel application and access all aws services… Read More
in this quick PHP tutorial, We'll discuss php_eol with examples. PHP_EOL is a predefined constant in PHP and represents an… Read More
This Laravel tutorial helps to understand table Relationships using Elequonte ORM. We'll explore laravel table Relationships usage and best practices… Read More
We'll explore different join methods of Laravel eloquent with examples. The join helps to fetch the data from multiple database… Read More
in this Laravel tutorial, We'll explore valet, which is a development environment for macOS minimalists. It's a lightweight Laravel development… Read More
I'll go through how to use soft delete in Laravel 10 in this post. The soft deletes are a method… Read More
View Comments
Thanks @Parvez for ths tutorial, after reading your tutorial I released a new version 1.1.0 that support Lumen.
Thanks for lovely package :)
Hello this library is abandoned, please use "php-flasher/flasher-laravel" instead
thanks