Laravel Packages

Laravel SMS Catcher: A Local Dashboard for SMS Notifications

Published
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.

Sponsored

serpapi logo
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi

The latest

View all →
WhenMounted and BigInt Props in Inertia.js v3.8 image

WhenMounted and BigInt Props in Inertia.js v3.8

Read article
Postcodes for Laravel: GB Postcode Lookup and Geography Data image

Postcodes for Laravel: GB Postcode Lookup and Geography Data

Read article
Laravel 14 Adds a defaults() Method to Eloquent Models image

Laravel 14 Adds a defaults() Method to Eloquent Models

Read article
Laravel AI SDK and Laravel MCP Security Fixes: Update Now image

Laravel AI SDK and Laravel MCP Security Fixes: Update Now

Read article
Mailbox for Laravel: Preview and Test Rendered Email image

Mailbox for Laravel: Preview and Test Rendered Email

Read article
Count Worker Crashes as Job Exceptions in Laravel 13.34 image

Count Worker Crashes as Job Exceptions in Laravel 13.34

Read article