- How do I install Laravel Notify in a Laravel project?
- Run `composer require mckenziearts/laravel-notify` to install via Composer. Publish the config and assets with `php artisan vendor:publish --tag=notify-config --tag=notify-assets` to customize defaults and include styles.
- Does Laravel Notify work with Laravel 13?
- Yes, the package explicitly supports Laravel 10, 11, 12, and 13. Check the [GitHub Actions](https://github.com/mckenziearts/laravel-notify/actions) for version-specific compatibility updates.
- Can I use Laravel Notify without Tailwind CSS?
- Yes, but you’ll need to manually include the pre-compiled CSS/JS assets published to `public/vendor/notify`. The package provides standalone styles, though Tailwind integration is optimized for seamless theming.
- What notification types does Laravel Notify support?
- The package includes 5 built-in types: **Toast** (basic), **Connectify** (connect-style), **Drakify** (dark theme), **Smiley** (emoji-based), and **Emotify** (animated emoji). All except Drakify require Alpine.js for interactivity.
- How do I trigger a notification from a controller?
- Use the fluent facade method: `Notify::success()->title('Success!')->message('Action completed.')->send()`. You can chain methods like `error()`, `warning()`, or `info()` for different styles.
- Are notifications actionable (e.g., buttons, redirects)?
- Yes, notifications support interactive actions via the `action()` method. For example, `Notify::success()->action('Undo', route('undo.action'))` adds a clickable button with CSRF protection handled automatically.
- Will Laravel Notify conflict with existing Alpine.js or Tailwind setups?
- Minimal risk if you publish assets to `public/vendor/notify`. For Tailwind, use `@source` to include Blade templates. Conflicts may arise if your project overrides Alpine.js directives or Tailwind’s default theme.
- How do I customize notification styles beyond the defaults?
- Override the Blade templates in `resources/views/vendor/notify` or extend the `notify.php` config. For Tailwind users, modify the `@layer` directives in the package’s CSS. Alpine.js behavior can be adjusted via data attributes.
- Does Laravel Notify support testing (e.g., Pest or PHPUnit)?
- Yes, the facade is dependency-injectable. Mock the `Notify` service in tests by binding a fake implementation in your `TestCase` setup. Example: `$this->app->bind(Notify::class, function() { return new FakeNotify(); });`
- What are the alternatives to Laravel Notify for Laravel flash messages?
- Alternatives include **laravel-notification-channels** (for email/SMS), **spatie/laravel-flash** (simpler toasts), or **laravel-toastr** (jQuery-based). Laravel Notify stands out for its Tailwind/Alpine integration and actionable notifications without jQuery dependencies.