What Is Laravel SMS Catcher?
Laravel SMS Catcher is a local development helper by Michal Skogemann that captures outgoing SMS notifications before they reach a real carrier. Think of it as the SMS equivalent of Mailpit: instead of sending texts to actual phone numbers during development, the package intercepts them and displays the content in a clean visual dashboard.
Installation
Install the package as a development dependency via Composer:
composer require --dev michal78/laravel-sms-catcher
Once installed, the dashboard is immediately available at /sms-catcher whenever your app runs in the local environment or has debug mode enabled. No migrations, no extra services.
How It Works
The package hooks into Laravel's notification system. When you dispatch a notification through the sms channel, SMS Catcher intercepts it by calling toSms() on your notification class. It then writes the sender, recipient, body, and timestamp to storage/logs/sms-catcher.json.
Using a flat JSON file has two practical benefits:
- No database setup — there are no tables or migrations to manage.
- Git-friendly — Laravel excludes
storage/logsfrom version control by default, so test messages never end up in your repository.
For the package to capture a notification, your notification class must implement a toSms() method that returns a string, array, or an object containing the message body.
Dashboard Features
Phone-Style Previews
Clicking a message in the sidebar opens a detail view with a phone-style mockup. A device selector dropdown lets you switch between screen widths to check how text wrapping, spacing, and line breaks render on different devices — useful for catching truncation issues before going to production.
Light and Dark Themes
The dashboard ships with both light and dark themes, so it fits comfortably alongside whatever IDE or terminal setup you prefer.
Inbox Management
You can clear individual messages or wipe the entire inbox directly from the dashboard, keeping your local log tidy during active development.
Environment Safety
The dashboard is blocked on production environments by default. It only activates when the app is running in local mode or has debug mode turned on, reducing the risk of accidentally exposing it.
Configuration
If the defaults don't suit your project, publish the configuration file:
php artisan vendor:publish --tag=sms-catcher-config
The resulting config/sms-catcher.php file exposes the following options:
SMS_CATCHER_ENABLED— toggle the catcher via an environment variable.route.prefix— set a custom URL path for the dashboard.route.middleware— wrap the dashboard routes with your own middleware.storage_path— change where the JSON message file is written.
Key Takeaways
- Drop-in SMS interception for local Laravel development, similar to how Mailpit handles email.
- Stores messages in a flat JSON file — no migrations or database tables needed.
- Phone-style mockup with a device selector helps you verify message formatting across screen sizes.
- Production-safe by default; only active in
localenvironment or debug mode. - Fully configurable URL prefix, middleware, and storage path via a published config file.
You can inspect the source code, report issues, and read the full documentation on the GitHub repository.
Source: Laravel News — Laravel SMS Catcher: A Local Dashboard for SMS Notifications