Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Fake Sms Notifier

Fake Sms Notifier Laravel Package

symfony/fake-sms-notifier

Fake SMS integration for Symfony Notifier that routes outgoing SMS as email or log messages during development. Configure via DSN with fakesms+email or fakesms+logger to test notifications without sending real texts.

View on GitHub
Deep Wiki
Context7

Fake SMS Notifier provides a development-only Symfony Notifier transport that simulates sending SMS messages without contacting a real gateway. Instead of dispatching texts, it routes them through email or the logger, making it easy to inspect outgoing messages locally or in staging environments.

Configure it with a simple DSN such as fakesms+email://default?to=TO&from=FROM or fakesms+logger://default, and optionally target a custom mailer transport.

  • Supports email and logger delivery channels
  • Configurable sender and recipient via DSN
  • Works with custom mailer transports
  • No third-party SMS provider or credentials required
  • Drop-in integration with Symfony Notifier
Frequently asked questions about Fake Sms Notifier
Can I use Symfony Fake SMS Notifier directly in Laravel without extra setup?
No, this package is designed for Symfony Notifier and requires custom integration in Laravel. You’ll need to create a Laravel Notification channel (e.g., `FakeSmsChannel`) to bridge Symfony’s transport system with Laravel’s notifications. This adds complexity but enables the fake SMS functionality.
How do I configure Fake SMS Notifier to send SMS as emails in Laravel?
Set the `FAKE_SMS_DSN` in your `.env` file to `fakesms+email://[email protected]&[email protected]`. For custom mailers (e.g., Mailchimp), use `fakesms+email://[email protected]&[email protected]`. Ensure your Laravel app has Symfony Notifier registered in the service container.
What Laravel versions support this package?
This package doesn’t natively support Laravel, but it works with Laravel 10.x if you integrate Symfony Notifier (~50+ dependencies). PHP 8.1+ is required, but Laravel 10.x’s LTS supports PHP 8.1–8.3. Upgrade PHP to 8.4+ for Symfony 7+ compatibility, which may introduce dependency conflicts.
How do I test SMS notifications in Laravel using this package?
Create a custom `FakeSmsChannel` in Laravel to dispatch notifications via Symfony Notifier. Use Laravel’s `via()` method to route notifications to the fake channel in development: `return app()->environment('local') ? ['fakesms'] : ['nexmo']`. Test by sending notifications and verifying emails/logs instead of real SMS.
Will this package conflict with Laravel’s built-in notification testing tools?
Yes, if you’re using `laravel-notification-testing` or similar, this package may duplicate functionality. Fake SMS Notifier logs or emails SMS content, while Laravel’s tools mock notifications directly. Choose one approach or build a unified solution to avoid redundancy.
Can I log fake SMS messages instead of sending them as emails?
Yes, configure the DSN in `.env` to `fakesms+logger://default`. This will log SMS messages via Symfony’s logger (e.g., Monolog). Ensure your Laravel logging configuration doesn’t suppress these logs, or route them to a dedicated channel for clarity.
How do I switch between fake and real SMS providers in production?
Use Laravel’s `via()` method to dynamically select channels based on the environment. For example, route to `['fakesms']` in `local` and `['nexmo']` in `production`. Ensure your `.env` file updates the `FAKE_SMS_DSN` or removes it entirely in production to avoid accidental fake SMS delivery.
Are there alternatives to this package for Laravel?
Yes, consider Laravel-native solutions like `laravel-notification-testing` for mocking notifications or custom channels that log/email SMS content. For Symfony users, this package is ideal, but Laravel teams may prefer lighter alternatives that avoid Symfony’s dependency overhead.
How do I handle dependency conflicts between Symfony Notifier and Laravel?
Symfony Notifier has extensive dependencies (e.g., Symfony Mailer, HTTP Client) that may conflict with Laravel’s ecosystem. Use Composer’s `replace` or `conflict` directives in `composer.json` to manage versions. Test thoroughly in a staging environment to catch conflicts early.
Does this package support Laravel’s queue system for fake SMS notifications?
No, this package doesn’t natively integrate with Laravel Queues. To use it with queues, wrap the Symfony Notifier call in a Laravel job and dispatch it via `dispatch()` or `dispatchSync()`. Alternatively, extend the `FakeSmsChannel` to support queued notifications manually.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk