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
Laravel Notify

Laravel Notify Laravel Package

mckenziearts/laravel-notify

Lightweight Laravel package for backend-driven toast notifications. Publish config/assets, drop in a Blade component, and trigger success/error/info messages from your app. Works great with Tailwind CSS and Alpine.js for smooth UI alerts.

View on GitHub
Deep Wiki
Context7

Flexible Flash notifications for Laravel

Frequently asked questions about Laravel Notify
How do I install and set up Laravel Notify in a Laravel 11 project?
Run `composer require mckenziearts/laravel-notify`, then publish the config and assets with `php artisan vendor:publish --tag=notify-assets --tag=notify-config`. Add `<x-notify::notify />` to your Blade layout and ensure Alpine.js is loaded. For Tailwind CSS, update your `app.css` to include the package’s Blade files via `@source`.
Can I use Laravel Notify without Tailwind CSS or Alpine.js?
Yes, but with limitations. The package provides pre-compiled assets for non-Tailwind projects, though customization may require manual CSS overrides. Alpine.js is required for interactivity (auto-dismiss, animations), but you can disable these features if needed. For vanilla JS fallbacks, you’ll need to extend the Blade component.
What Laravel versions does this package support, and what’s the PHP requirement?
Laravel Notify is officially tested with Laravel 10–13 and requires PHP 8.1+. Older Laravel versions (e.g., 9.x) may work but aren’t guaranteed due to dependency changes. Always check the [GitHub actions](https://github.com/mckenziearts/laravel-notify/actions) for compatibility updates.
How do I trigger a notification from a controller or middleware?
Use the `notify()` facade: `notify()->success()->title('Action completed')->send()`. For middleware, inject the facade or use `session()->flash()` with the package’s session keys. Notifications are session-based, so they’ll appear on the next request (e.g., after a redirect).
Are notifications accessible (WCAG compliant) by default?
The package includes ARIA attributes and keyboard navigation support out of the box, but full WCAG compliance depends on your customization. For critical accessibility needs, review the Blade component (`resources/views/vendor/notify/notify.blade.php`) and override it to add features like screen reader announcements or contrast adjustments.
What happens if a user has JavaScript disabled? Will notifications still work?
Notifications rely on Alpine.js for dynamic behavior (e.g., auto-dismiss, animations), but the core functionality—displaying flash messages—works without JS. The package renders notifications as static HTML if JS fails. For critical feedback, pair with Laravel’s native `session()->flash()` as a fallback.
Can I customize the notification styles beyond Tailwind’s defaults?
Yes, publish the assets (`php artisan vendor:publish --tag=notify-assets`) to override the Blade component and CSS. For Tailwind projects, extend your `tailwind.config.js` to customize colors, spacing, or animations. Non-Tailwind users must manually override the pre-compiled styles in their CSS.
Does Laravel Notify work with Laravel Livewire or Inertia.js?
The package is Blade-focused and works alongside Livewire/Inertia, but integration requires careful handling. For Livewire, trigger notifications in component methods and ensure Alpine.js doesn’t conflict with Livewire’s reactivity. Inertia.js projects may need to adapt the Blade component to React/Vue syntax, as notifications rely on server-rendered flash data.
How do I test notifications in PHPUnit? Are there built-in helpers?
There are no built-in test helpers, but you can test notifications by flashing session data manually in tests: `session()->flash('notify', ['type' => 'success', 'title' => 'Test']);` and asserting the Blade component renders correctly. Mock the `notify()` facade or use HTTP tests to simulate redirects with notifications.
What are the alternatives to Laravel Notify for flash notifications?
Alternatives include `spatie/laravel-flash` (simpler, no frontend dependencies), `darkaonline/l5-swagger` (for API docs), or `torann/laravel-notification-channels` (for multi-channel notifications). For Tailwind/Alpine.js integration, `filament/support` (Filament’s notification system) is another option, though it’s heavier. Choose based on your need for frontend interactivity.
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
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata