symfony/mobyt-notifier
Symfony Notifier bridge for Mobyt SMS. Configure via MOBYT_DSN with user key, access token, sender, and message quality. Supports MobytOptions to customize message type and other delivery parameters when sending SmsMessage.
illuminate/notifications). However, Laravel’s Notification system is not a drop-in replacement for Symfony Notifier, requiring custom integration work to bridge the two.mobyt://...) is clean and Laravel-friendly, fitting seamlessly into .env files and Laravel’s configuration patterns.N, L, LL) on deliverability and cost?
TYPE_QUALITY affect SMS success rates or pricing in a way that aligns with our use case?symfony/notifier:^6.4).composer require symfony/notifier mobyt/mobyt-notifier
Illuminate\Notifications\NotificationChannel or use a service provider to bind the Symfony transport.// app/Providers/AppServiceProvider.php
use Symfony\Component\Notifier\Notifier;
use Symfony\Component\Notifier\Transport\MobytTransport;
public function register()
{
$this->app->singleton('mobyt.transport', function ($app) {
$dsn = config('services.mobyt.dsn');
return new MobytTransport($dsn);
});
$this->app->singleton('mobyt.notifier', function ($app) {
return new Notifier([$app->make('mobyt.transport')]);
});
}
.env:
MOBYT_DSN=mobyt://USER_KEY:ACCESS_TOKEN@default?from=FROM_PHONE&type_quality=N
// app/Notifications/Channels/MobytChannel.php
use Illuminate\Notifications\NotificationChannel;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\Mobyt\MobytOptions;
class MobytChannel implements NotificationChannel
{
public function send($notifiable, Notification $notification)
{
$mobyt = app('mobyt.notifier');
$message = new SmsMessage($notifiable->phone, $notification->toMobyt($notifiable));
if ($notification->options) {
$message->options($notification->options);
}
$mobyt->send($message);
}
}
// app/Notifications/SmsNotification.php
use App\Notifications\Channels\MobytChannel;
class SmsNotification extends Notification
{
public function via($notifiable)
{
return [MobytChannel::class];
}
public function toMobyt($notifiable)
{
return 'Your message here';
}
}
composer.json to avoid unexpected upgrades..env, secrets manager).How can I help you explore Laravel packages today?