- What does the orchid/alert package do in a Laravel Orchid admin panel?
- Orchid Alert is a presentation-layer add-on for Laravel Orchid that renders dismissible alert notifications inside Orchid layouts. It provides a session-backed flash bag with success, info, warning, and error styles, a Blade partial, and a small API for pushing messages before redirects. It is admin-UX polish only and does not add database tables, migrations, workers, or new deployables.
- How do I install orchid/alert with Composer?
- Install it as a Composer dependency in your Laravel application and let the package service provider register itself. In many Orchid projects the package may already arrive transitively through orchid/platform, so check with composer show orchid/alert before adding a direct composer.json entry. Only add a direct dependency if your own code actually calls the package API rather than just using session flash.
- Which Laravel and Orchid versions does orchid/alert support?
- The package targets Laravel Orchid admin panels on Laravel 9 through 11, using Blade rendering and session-based flash storage. Because the repository shows no visible release cadence or dependents, verify the actual constraint set against your lockfile with composer why-not rather than trusting the README. If the resolved Orchid major is incompatible, pin the package or replace it with a local Blade partial.
- How do I show a success or error alert after a redirect in Orchid?
- Push a flash message to the session before returning your redirect, using the package's documented flash keys for success, info, warning, and error. Orchid's layout then renders the alert partial on the next request. Wrap those calls in a one-method internal helper such as AdminAlerts::success($message) so you can fork, replace, or swap the implementation later without touching every controller.
- Can I use orchid/alert outside Laravel Orchid, for example in plain Laravel or Filament?
- No, orchid/alert is built for Laravel Orchid layouts and has no insertion point in plain Laravel, Filament, Nova, or a hand-rolled Blade back office. In those stacks a short session()->flash() helper plus one owned Blade partial covers the same requirement with zero third-party surface. Use Laravel Notifications with a database channel instead if you need durable or auditable notifications.
- How do I customize the styling of Orchid alert messages?
- The alerts are rendered through a Blade partial inside the Orchid layout, so visual changes normally mean overriding or publishing that view in your theme. Check whether your custom Orchid theme already overrides the partial, because an override can silently stop messages from appearing. Keep styling changes in your own views where possible so a future package update cannot break your admin feedback.
- Why are my Orchid flash alerts not showing up at all?
- The most common production surprise is silent non-rendering: messages are pushed to the session but the layout omits the alert partial, or a custom theme overrides it, so nothing displays and no error is raised. Confirm that your shipped admin layout, including theme overrides, actually includes the partial. Also check that the session driver is working and that flash data survives the redirect.
- Is orchid/alert safe from XSS when alert messages contain user input?
- Escaping is conditional and must be verified by reading the shipped Blade view before merging. If you interpolate user-controlled values such as a filename in an Import failed message into an unescaped partial, you create a stored-XSS vector in a privileged admin context. Escape or sanitize dynamic content at the call site, or render messages through your own escaped partial.
- How should I test Orchid alerts in my Laravel application?
- Assert that your controller flashes the expected keys and that the redirect response carries the session data, then render the admin page and check that the alert text appears in the HTML. Include a test for the layout containing the alert partial so a theme change cannot silently remove it. If you wrap calls behind an internal AdminAlerts helper, test the helper once and keep controller tests focused on behavior.
- Is orchid/alert maintained, and what are the alternatives if it is abandoned?
- The package has no stars, no dependents, and no visible release cadence, so assume there will be no upstream fix for a future Orchid layout change. The surface is tiny, so mitigation is cheap: fork it, vendor the partial, or replace it with an internal session flash helper behind one method. For acknowledgement, history, severity routing, or on-call escalation, reject this primitive early and use Laravel Notifications instead.