illuminate/notifications
Illuminate Notifications is Laravel’s notification component, providing a unified way to send notifications across channels like mail, database, broadcast, SMS, and Slack. Supports queued delivery, localization, and flexible routing for notifiable models.
Begin by installing the package via Composer (composer require illuminate/notifications) in a Laravel 13+ application. While this package is a subtree split—not intended for direct standalone use—it's essential for developers extending Laravel’s notification system. In practice, you’ll interact with notifications through Laravel’s Notification facade (use Illuminate\Support\Facades\Notification;) or the Notifiable trait. The first use case is sending a simple notification (e.g., MailMessage) to a user:
Notification::send($user, new OrderShipped($order));
Check app/Notifications for generated notification classes, and review resources/views/notifications for email templates.
InvoicePaid, Alert) implementing Via methods (mail, database, broadcast, slack, etc.).via($notifiable)—the system automatically routes via each channel (e.g., mail, database, Pusher).Notification::queue() to dispatch notifications via the queue worker (requires queue channel and a configured queue driver).Channel classes (e.g., SlackChannel) and register them in app/Providers/EventServiceProvider’s boot() method.shouldSend($notifiable, $channel) to skip channel-specific delivery (e.g., don’t email if user opted out).Notification::fake() to assert notifications were sent, queued, or not sent—ideal for integration tests.laravel/framework instead unless patching core.vendor:publish --tag=laravel-notifications. If views aren’t rendering, check resources/views/notifications/ and ensure toMail() returns a MailMessage with correct properties.queue() are stored in jobs table. Monitor failed jobs with php artisan queue:fail—notifications don’t auto-retry unless retry_until is set in config/queue.illuminate/broadcasting, illuminate/mail, etc., are available (via Laravel’s meta-package) and service providers are registered.logError() in your notification class or use Notification::logChannels() for runtime diagnostics.SmsGateway into the channel—don’t hardcode dependencies in to{Channel}().How can I help you explore Laravel packages today?