Laravel SMS Catcher: A Local Dashboard for SMS Notifications

Last updated on by

Laravel SMS Catcher: A Local Dashboard for SMS Notifications image

Laravel SMS Catcher is a local development helper by Michal Skogemann that captures outgoing SMS notifications. Much like Mailpit does for email, it gives you a visual dashboard to inspect the text body and metadata of your SMS messages while working locally.

Main Features

  • Phone-style preview — Displays text inside a virtual device mockup with a selector to check how line wrapping looks on different screen widths.
  • Environment-safe defaults — Blocks the dashboard on production environments, running only in local or debug modes.
  • Customizable routing — Lets you customize the dashboard URL path and wrap routes with your own middleware.
  • Flat-file storage — Stores messages in a local JSON file in your logs directory, bypassing the need for database tables or migrations.
  • Inbox management — Clears individual messages or wipes the entire inbox from the dashboard.

How It Works

The catcher hooks into Laravel's notification system. When you send a notification via the sms channel, the package intercepts it by calling toSms on the notification class. It then writes the sender, recipient, body, and timestamp to storage/logs/sms-catcher.json.

Writing to a flat JSON file means there are no database tables or migrations to set up. Since Laravel excludes the storage/logs directory from git by default, your test messages won't clutter your repository.

Dashboard and Phone Previews

The dashboard comes with light and dark themes. Clicking a message in the sidebar opens a detail view with a phone-style mockup. A device selector dropdown lets you switch between screen sizes to see how text wrapping, spacing, and line breaks look on different devices.

Screenshot of the SMS Catcher Message Detail view
SMS Catcher Message Detail view

Configuration

Out of the box, the inbox is available at /sms-catcher whenever your app runs in the local environment or has debug mode turned on. If you need to change these settings, you can publish the configuration file:

php artisan vendor:publish --tag=sms-catcher-config

The resulting config/sms-catcher.php file lets you:

  • Toggle the catcher using the SMS_CATCHER_ENABLED env variable.
  • Set a custom URL prefix (route.prefix).
  • Adjust the middleware stack (route.middleware).
  • Change where the messages are stored (storage_path).

Installation

You can install the package as a development dependency via Composer:

composer require --dev michal78/laravel-sms-catcher

To capture your messages, make sure your notification classes have a toSms() method that returns a string, array, or an object containing the message body.

You can inspect the source code, report issues, and read the documentation on the GitHub repository.

Yannick Lyn Fatt photo

Staff Writer at Laravel News and Full stack web developer.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing

The latest

View all →
Laravel Time Machine: A Request Lifecycle Profiler image

Laravel Time Machine: A Request Lifecycle Profiler

Read article
The Analytics Stack for Laravel: Traffic, Revenue and Attribution in One Place image

The Analytics Stack for Laravel: Traffic, Revenue and Attribution in One Place

Read article
Scaffold Packages with the `laravel package` Command in Laravel Installer v5.31.0 image

Scaffold Packages with the `laravel package` Command in Laravel Installer v5.31.0

Read article
Vocalizer: Local Text-to-Speech for PHP image

Vocalizer: Local Text-to-Speech for PHP

Read article
Build a Laravel Scout Search Endpoint With the HTTP QUERY Method image

Build a Laravel Scout Search Endpoint With the HTTP QUERY Method

Read article
Enforce Per-Action Waiting Periods in Laravel with Cooldown image

Enforce Per-Action Waiting Periods in Laravel with Cooldown

Read article