- What is AvalynxAlert and what does it do in a Laravel application?
- AvalynxAlert is a lightweight alert system that lets you render configurable success, error, warning, and info notifications in your web application. In Laravel it provides simple helpers for triggering those alerts and supports session-friendly flash messages that survive a redirect. It relies on Bootstrap 5.3 or higher for styling, so the alerts inherit your existing Bootstrap theme.
- How do I install avalynx/avalynx-alert with Composer?
- Install it with Composer by running composer require avalynx/avalynx-alert from your project root. After installation, check the README for any service provider registration or asset publishing steps needed for your Laravel version. If you use package discovery, the provider is typically registered automatically.
- Which Laravel versions and PHP versions are supported?
- The package is distributed through Composer as avalynx/avalynx-alert and targets modern Laravel applications running PHP 8 and above. Because exact constraints can change between releases, confirm the supported Laravel and PHP ranges in the package's composer.json before upgrading. The front-end side requires Bootstrap 5.3 or newer to render alerts correctly.
- Does AvalynxAlert require Bootstrap, and can I use it without Bootstrap?
- Yes, AvalynxAlert is designed around Bootstrap 5.3 or higher, so Bootstrap must be present on the page for the alert styling to work. The package itself is described as lightweight and dependency-free on the PHP side, meaning it does not pull in extra Composer dependencies. If you are not using Bootstrap, you would need to supply your own CSS for the alert markup.
- How do I show a success, error, warning, or info alert?
- AvalynxAlert provides simple helpers for the common alert types: success, error, warning, and info. You call the appropriate helper from your controller or view and it prepares the alert message for display. This keeps your controller code readable instead of manually building alert arrays or HTML each time.
- Can I position alerts anywhere on the screen?
- Yes, one of the main features of AvalynxAlert is configurable positioning, so alerts can be placed in different areas of the screen rather than being locked to the top of the page. Positioning is handled alongside the customizable styling options. Check the README for the exact position options and how to set them per alert or globally.
- How do flash messages work with AvalynxAlert in Laravel?
- AvalynxAlert is session-friendly, so alerts can be flashed to the session and displayed after a redirect. This fits the standard Laravel pattern of redirecting back with a success or error notification after form submissions. You trigger the alert before the redirect and the package reads it from the session on the next request.
- Can I customize the styling and appearance of the alerts?
- Yes, the alerts are customizable and, because they are built on Bootstrap 5.3 classes, you can override colors, icons, and layout through your own CSS or Bootstrap theme variables. The package focuses on a seamless integration with your existing front-end rather than imposing its own design system. Consult the README for the available styling options and markup hooks.
- How should I test alerts in my Laravel test suite?
- For feature tests, assert that the alert was flashed to the session, for example with assertSessionHas, after hitting the route that triggers the notification. That verifies your controller wiring without depending on JavaScript or rendered markup. If you need to check rendering, make a follow-up request and assert the alert text appears in the response.
- Is AvalynxAlert suitable for production, and what are the alternatives?
- AvalynxAlert is a small, focused package for Bootstrap-based alert notifications, which makes it a reasonable fit for production Laravel apps already using Bootstrap 5.3 or newer. It is not a full notification system with email, database, or queue support, so for those needs look at Laravel's built-in notifications or packages like spatie/laravel-flash. Before adopting it, check the repository's recent commits and releases to confirm it is actively maintained.