-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toastr Notifications Not Displaying in Laravel 11.9 Controller #51
Comments
Hello Reham, Thank you for providing all the details! Could you please try registering the <?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
// Other middleware...
\Flasher\Laravel\Middleware\FlasherMiddleware::class,
];
// Other properties and methods...
} This should ensure that the middleware is properly registered and can handle the flash notifications. If adding the middleware doesn't resolve the issue, please share a project on GitHub where you can reproduce the issue, and I'd be glad to help you fix it. Looking forward to your feedback! Best regards, |
Hello @yoeunes, Thank you for your guidance—it worked perfectly for me! After registering the middleware in kernel.php, the notifications populated successfully. I believe it would greatly enhance user experience if this step or a note about it could be added as part of the installation/configuration steps. It would save users a lot of time. However, I'm facing another issue where the notification is triggered with each page refresh, even in cases where it shouldn't be. Do you have any recommendations on how to address this issue? Thanks in advance! |
Hi Reham, Thanks for the feedback! You’re absolutely right about documenting that step, and I’ll definitely add it when I get the chance. If you’re open to it, it would be awesome if you could contribute by adding this note to the documentation as well. Regarding the notifications being triggered on each page refresh, it sounds like it might be similar to another issue we’ve seen. Could you take a look at this comment and see if it helps: php-flasher/php-flasher#188 (comment)? Feel free to reach out if anything else comes up! |
Hello, I'm using Laravel 11.9 and following the instructions to integrate Toastr notifications with the Flasher package in my application. However, the notifications are not displaying as expected.
Problem:
After saving a new grade, I expect a Toastr notification to appear confirming that the data was saved successfully. However, no notifications are displayed.
Expected Behavior:
A Toastr notification should display a success message when the grade is successfully saved.
Actual Behavior:
No notifications are displayed, even though the session data contains the notification information.
Additional Information:
Laravel Version: 11.9
PHP Version: 8.2
Flasher Package: php-flasher/flasher-toastr
Could you please assist in identifying why the Toastr notifications aren't displaying?
Thank you!
The text was updated successfully, but these errors were encountered: