0058-laravel-notification-patterns

Community

Deliver Laravel notifications across channels.

AuthorMrJmpl3
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It solves the problem of building maintainable, reliable Laravel notifications that reach users through multiple channels (mail, database, broadcast, and more) without duplicating logic or missing key production concerns like queuing, conditional sending, and testing.

Core Features & Use Cases

  • Multi-channel delivery: Use via() to send notifications over channels such as mail, database, and broadcast from a single notification class.
  • Channel-specific formatting: Implement toMail(), toArray(), toBroadcast(), and additional channel methods (e.g., Slack) so each medium receives the right payload.
  • Production-ready behavior: Enable queueing with ShouldQueue and Queueable, support afterCommit, configure per-channel queues with viaQueues(), and add retry/failure handling.
  • Data persistence and broadcasting: Store only serializable values in toArray() for database notifications and emit broadcast payloads via BroadcastMessage.
  • Targeting and delivery controls: Use shouldSend() for per-notifiable/per-channel decisions and support on-demand recipients using Notification::route().
  • Testing and quality checks: Use Notification::fake() with assertions for sent/not-sent notifications and validate mail content.

Quick Start

Create a notification class that uses via() to return mail, database, and broadcast, then implement toMail() for the email content and toArray() for the database payload.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: 0058-laravel-notification-patterns
Download link: https://github.com/MrJmpl3/codex_____data_____configuration/archive/main.zip#0058-laravel-notification-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.