Laravel notifications are easy to start and easy to get wrong at scale. This tutorial focuses on the production details: channel choice, queue behavior, and delivery testing.

What you will build

  • a queued Laravel notification class
  • a mail channel implementation with custom subject/from metadata
  • an optional SMS channel strategy
  • a repeatable test that verifies the notification actually arrives

Channel selection matrix

ChannelBest forCommon failure modeGuardrail
Mailaccount verification, receipts, workflow alertsqueue delay or provider throttlingqueue monitoring + deterministic inbox tests
SMSOTP and urgent short-form eventsprovider limits and regional restrictionsretry policy + fallback channel
Slackinternal incident/event broadcastwebhook misconfigurationsigned webhook checks + alert routing tests
Database/UIin-app notificationsstale read state in clientsread-state assertions and pagination tests

Step 1: Create a notification class

Example notification with queueing:

Step 2: Dispatch through the queue

Use queue workers for notification delivery so web requests stay fast.

In code:

Step 3: Test notification delivery with real inboxes

Unit tests verify class behavior, but integration tests should prove real delivery. MailSlurp can create isolated inboxes for each test run and wait for expected messages.

Use this pattern for password reset, email verification, billing receipts, and admin workflow notifications.

How to inspect queued notifications

Use these checks during incident triage:

  • queue depth and worker health
  • failed jobs table
  • provider response codes (throttle, reject, timeout)
  • per-notification send latency

If notifications are delayed, fix queue pressure before changing templates or content.

Laravel notification hardening checklist

  • implement for non-trivial notifications
  • set explicit retry and backoff settings
  • include idempotency strategy for repeatable triggers
  • test delivery end to end in CI, not only in local mail preview
  • track send failure rate and median delivery latency