Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Toast Bundle

Toast Bundle Laravel Package

asmitta-01/toast-bundle

View on GitHub
Deep Wiki
Context7

A Symfony bundle for displaying Bootstrap toast messages from flash messages.

Frequently asked questions about Toast Bundle
Can I use this Symfony ToastBundle in Laravel without major refactoring?
No, this bundle is Symfony-specific and relies on Symfony’s flash message system. You’d need a custom service layer to bridge Laravel’s `session()->flash()` to Symfony’s flash bag. Consider Laravel-native alternatives like `spatie/laravel-flash` for tighter integration.
How do I integrate this bundle’s CSS/JS with Laravel Mix or Vite?
The bundle requires `assets:install`, but in Laravel, manually publish assets via `php artisan vendor:publish --tag=asmitta-toast-assets` or import the CSS directly in your Vite/Mix config. Avoid `assets:install` in Laravel—use Laravel’s asset pipeline instead.
Will this bundle work with Laravel’s Blade templates instead of Twig?
No, the bundle is Twig-dependent. For Blade, you’d need to create a custom view composer or service to render toasts in Blade, which isn’t officially supported. Stick to Twig or use a Laravel-specific package.
How do I customize toast styles to match Laravel’s existing UI (e.g., Blade templates)?
Override the Twig templates by copying them from `vendor/asmitta-toast-bundle/Resources/views/` to your project’s `templates/asmitta_toast/` directory. Modify the CSS in `public/bundles/asmittaToast/css/` to align with your Laravel theme.
Does this bundle support Laravel’s session flash messages (e.g., `session()->flash('error', '...')`)?
No, it only works with Symfony’s `addFlash()` method. To use Laravel’s session flashes, create a middleware or service that converts Laravel’s session flashes into Symfony’s flash bag before rendering the Twig template.
Are there performance concerns with auto-hiding toasts (default: 5s)?
The 5-second auto-hide is configurable via YAML (`config/packages/asmitta_toast.yaml`). For critical UX flows, disable auto-hide (`auto_hide: false`) or extend the duration. Test in production to ensure it doesn’t disrupt user interactions.
What are the risks of using a package with 0 GitHub stars and no community?
Low adoption suggests unproven stability, but the MIT license and active changelog (Symfony 8 support) indicate maintenance. Test in a staging environment first. If critical, consider alternatives like `laravel-notification-channels` or `spatie/laravel-flash`.
Can I remove the Bootstrap Icons dependency if I don’t need icons?
Yes, exclude the Bootstrap Icons CSS link (`bootstrap-icons.min.css`) from your template. The bundle’s core functionality (toasts, styling) works without icons. Use custom icons or omit them entirely.
How do I handle Symfony version upgrades (e.g., Symfony 9) in a Laravel project?
This bundle isn’t Laravel-native, so upgrades depend on your wrapper layer. Monitor the bundle’s changelog for breaking changes (e.g., CSS class renames in v0.4.0). Test thoroughly in a non-production environment before upgrading.
What’s a better alternative for Laravel if I need toast notifications?
For Laravel, consider `spatie/laravel-flash` (simple, Blade-compatible) or `laravel-notification-channels` (for advanced UX). These are Laravel-first, avoid Symfony dependencies, and integrate seamlessly with Blade and Tailwind/CSS frameworks.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi