🔔 Flasher is a powerful and flexible flash notification system for PHP, Laravel, Symfony

Overview

flasher

A powerful and flexible flash notifications system for PHP, Laravel, Symfony

👀 PHP Flasher helps you to add flash notifications to your PHP projects. This library was developed with the idea that you should be able to add flash notification to your application with ease and with few lines of code. No application-wide rewrites and no big investments upfront.

Why use PHP Flasher ?

The PHP Flasher project supports many notification libraries : tailwindcss, bootstrap, toastr.js, sweet alert 2, pnotify, noty, and notyf and its highly extendable so you can add your custom notifications.

This library is designed, so you can take full control when creating you notifications :

  • Display multiple notifications
  • Sort and filter notifications
  • Render notification from JSON object
  • Limit the number of displayed notifications
  • Show notifications from different libraries at the same time
  • Framework angostic with integration for : Symfony and Laravel
  • Support templates
  • Easy migration from similar libraries.
  • Very flexible so you can add you own adapters
  • ...and more

Official Documentation

Documentation for PHP Flasher can be found on the PHP Flasher website.

Contact

PHP Flasher is being actively developed by yoeunes. You can reach out with questions, bug reports, or feature requests on any of the following:

License

PHP Flasher is open-sourced software licensed under the MIT license.

Made with ❤️ by Younes KHOUBZA

Comments
  • Flashes not working with hotwired/turbo

    Flashes not working with hotwired/turbo

    Is your feature request related to a problem? Please describe. Flashes are not working with turbo enabled. If I add data-turbo="false" to the body they work like expected.

    Describe the solution you'd like I'd like to make use of turbo.

    Describe alternatives you've considered Maybe a special div to where the flashes are rendered, so that only that div can be excluded from turbo?

    help wanted findapr 
    opened by 24unix 12
  • How can i move the flash-toastr.min.js file for flasher-toastr-laravel from cdn to local

    How can i move the flash-toastr.min.js file for flasher-toastr-laravel from cdn to local

    Hey,

    First of all amazing package and very nice work. I can find the config file for flasher-laravel and i can override the js file there but how do i move the js file of this adapter "flasher-toastr-larave" from cdn to local.

    Thankyou

    opened by wcaaan 9
  • Class

    Class "Flasher\Prime\Flasher" not found

    I got the error "Class "Flasher\Prime\Flasher" not found" in Laravel 9 with the Windows 11 operating system, I think this error is because the Windows operating system cannot have a file with the same name as in the php-flasher package, namely the Flasher file. php and flasher.php, if on linux I don't think there is a problem.

    opened by a3m-nix 6
  • Call to undefined function

    Call to undefined function

    hi

    how can i fix this:

    Call to undefined function App\Http\Livewire\Admin\Languages\toastr()

    u get this error when call this method in livewire render method:

    toastr()->livewire()->addSuccess('notification using toastr library');

    thank you

    opened by asadghazanfary 5
  • Ability to set persistent toasts

    Ability to set persistent toasts

    Most libraries allow timeout to be set to 0 to keep the toast visible. flasher-js code does not seem to allow that.

    Additionally, I noticed (at least in Laravel) setting an option on the message builder does not seem to apply like the options set in config/flasher.php

    opened by murrant 4
  • Icon's background size error

    Icon's background size error

    Describe the bug Hi guys, the library is great, i'm using this with Tall Stack, the problem occurs when i invoke the flash() from a helper file (i mean i have a file, outside of our components in which i have a lot of functions) one of those functions is used to retrieve some data using SOAP, and i'm trying to display a flash notification when a problem occurs. The main problem is that the icon's background is not loaded correctly, as you can see in the attached picture image

    This is how i invoke the flash()

    if (count($response->RespuestaCuis->mensajesList) > 1) {
                    foreach ($response->RespuestaCuis->mensajesList as $errorMessage) {
                        flash()->addFlash('error', $errorMessage->codigo . ": " . $errorMessage->descripcion, 'Errores al generar el CUIS', ['hops' => 5]);
                    }
                } else {
                    flash()->addFlash('error', $response->RespuestaCuis->mensajesList->codigo . ": " . $response->RespuestaCuis->mensajesList->descripcion, 'Error al generar el CUIS');
                }
                return false;
    

    Thank you so much for your time!

    opened by Kashorako 3
  • Where can I change the appearance location?

    Where can I change the appearance location?

    Hey I just started using Flasher in an Symfony project but I cant find an option to change the notification locations. Currently it appears at the right side on the top but I would like it to be on the right bottom location. Is that possible?

    Thanks in advance!

    opened by Bxnnet 3
  • Not displayed after redirect from livewire component

    Not displayed after redirect from livewire component

    Describe the bug If a redirect is triggered from within a livewire component, the flasher output is never displayed as the request that would have triggered it originated within a livewire component, and the does not appear to be any mechanism available to delay the display until a future request in that case.

    Whereas it is otherwise possible to define hops or delay stamps this does not appear to be possible from within a livewire component.

    As a redirect causes a page reload, and as best I can tell presently display of flasher messages that originate within a livewire component occur as events rather than being added to the message bag in the session, the is presently no way to display a message after redirect.

    To Reproduce Steps to reproduce the behavior:

    1. Add a flasher message within a livewire component, and then redirect to a different page, observe no message displayed
    2. Add a flasher message within a livewire component and do NOT redirect, and observe message IS displayed

    Expected behavior I expect the notification to display after redirect, even if that requires me adding an extra flag when defining the message, so that for example when saving an entity and then redirecting to a list view - the save message is properly displayed.

    Desktop (please complete the following information):

    • OS: macOS
    • Browser Firefox
    • Version 100
    opened by willvincent 3
  • Flasher for blade rendering validation errors

    Flasher for blade rendering validation errors

    Hey can you please update the documentation about how to pass the flasherInterface from view to show my validation errors, i tried checking out the blade documentation but its empty. appreciate the help.

    I've created an error blade file which will render my validation errors, for now I'am using Flasher Facade, is there a better way to do this.

    <?php
    	use Flasher\Laravel\Facade\Flasher;
    ?>
        @if(isset($errors) && count($errors) > 0)
    		@foreach($errors->all() as $error)
    			<strong>@php Flasher::addError($error) @endphp</strong>
    		@endforeach
    	@endif
    
    opened by wcaaan 2
  • Livewire using main flasher

    Livewire using main flasher

    Thanks for creating this awesome alert. I saw in docs that livewire can only use toastr or sweetalert? Is it possible to use the main flasher (the one with white background and left border color) ?

    thanks

    opened by jonathanoeijoeng 2
  • Flasher is not working in Store, Update or Delete functions, but working in Index function ?

    Flasher is not working in Store, Update or Delete functions, but working in Index function ?

    Hello Sir,

    Working in Index Method :

        public function index(FlasherInterface $flasher)
        {
            $users = User::all();
            $flasher->addSuccess('Welcome To Users Section');
            return view('admin.users.index', compact('users'));
        }
    

    But not working in :

        public function destroy(FlasherInterface $flasher, User $user)
        {
            $user->delete();
            $flasher->addSuccess('User Deleted!');
            return redirect()->back();
        }
    

    What is the reason, Am I doing anything wrong ?

    laravel framework = 9.11 package = 1.4.0

    opened by ravindra135 2
  • laravel helper flash() function options

    laravel helper flash() function options

    Is there a list somewhere within the docs listing all the options that can be passed in the options array of laravels flash() helper function? The docs aren't very clear. I couldnt change the duration of the alert for example. i tried ['duration' => 1000] and ['timer' => 1000]. I would like to know what all the options are that can be passed in.

    opened by Deniz073 0
Owner
PHP Flasher
A powerful and flexible flash notification system for PHP
PHP Flasher
A package to flash multiple messages using Laravels default session message flashing system

Flash multiple advanced messages with both text, messages and links An opinionated solution for flashing multiple advanced messages from the backend a

Bilfeldt 6 Jan 18, 2022
Laravel 5 Flash Notifications with icons and animations and with a timeout

Notify (Laravel) Notify alert boxes to the browser with sound and font awesome icons and give it a timeout to fly out. Works great to notify the user

Ben-Piet O'Callaghan 31 Oct 8, 2022
A helper package to flash a bootstrap alert to the browser via a Facade or a helper function.

Alert Box (Laravel) A helper package to flash a bootstrap alert to the browser via a Facade or a helper function. <div class="alert alert-info fade in

Ben-Piet O'Callaghan 17 Dec 30, 2022
Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with Firebase Cloud Messaging (FCM).

Laravel-FCM Introduction Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with Firebase Cloud M

Rahul Thapa 2 Oct 16, 2022
Realtime Notification Module With Laravel & Pusher

About Noftiy Module This module to organize the notification process in real time without need to reload page, using PHP language with Laravel framewo

Mohamed Magdy 1 Jan 9, 2022
📲 SmsOffice.ge service with notification channel for Laravel

Laravel SmsOffice This package allows you to send SMS messages with SmsOffice.ge API You can send sms with notification class or directly with SmsOffi

Levan Lotuashvili 11 Dec 24, 2022
Provides a powerful error response system for Laravel

Laravel Exceptions Laravel Exceptions was created by, and is maintained by Graham Campbell, and provides a powerful error response system for both dev

Graham Campbell 571 Jan 31, 2022
An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality.

Support An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality. Ins

Ian Olson 3 Apr 14, 2021
Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications.

Laravel Boilerplate Project Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications. Table of Con

Labs64 848 Dec 28, 2022
Extend Kirby’s templates with a powerful layout system

Kirby Layouts plugin This plugin extends Kirby’s templates with a powerful layout system. Installation Download Download and copy this repository to /

Kirby 3 39 Dec 28, 2022
Entrust is a succinct and flexible way to add Role-based Permissions to Laravel 5.

ENTRUST (Laravel 5 Package) Entrust is a succinct and flexible way to add Role-based Permissions to Laravel 5. If you are looking for the Laravel 4 ve

Zizaco 6.1k Dec 31, 2022
A flexible, seamless and easy to use multitenancy solution for Laravel

Main: Develop: Tenanted Laravel A flexible, seamless and easy to use multitenancy solution for Laravel This package is currently under development. Ch

Tenanted Laravel 12 May 29, 2023
Laravel 5 Repositories is used to abstract the data layer, making our application more flexible to maintain.

Laravel 5 Repositories is used to abstract the data layer, making our application more flexible to maintain.

Anderson Andrade 4k Jan 6, 2023
Output complex, flexible, AJAX/RESTful data structures.

Fractal Fractal provides a presentation and transformation layer for complex data output, the like found in RESTful APIs, and works really well with J

The League of Extraordinary Packages 3.5k Dec 26, 2022
cybercog 996 Dec 28, 2022
A powerful form builder, for Laravel and other frameworks (stand-alone too)

Former A Laravelish way to create and format forms Former outputs form elements in HTML compatible with your favorite CSS framework (Bootstrap and Fou

null 1.3k Dec 22, 2022
Laravel is accessible, powerful, and provides tools required for large, robust applications.

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be trul

Web & Mobile | eCommerce | Full-Stack Developer 4 Nov 24, 2022
HydePHP - Elegant and Powerful Static App Builder

HydePHP - Elegant and Powerful Static App Builder Make static websites, blogs, and documentation pages with the tools you already know and love. About

HydePHP 31 Dec 29, 2022
Powerful Unsplash package for Laravel

Powerful Unsplash package for Laravel Provides a fluent api to use the Unsplash within Larvel applications. Use public actions or store images directl

null 54 Dec 25, 2022