frolax / ultimate-sms-notification-channel
Laravel notification channel for Ultimate SMS
v1.0.0
2025-07-03 16:43 UTC
Requires
- php: ^8.0
- illuminate/notifications: ^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
README
This package provides a Laravel notification channel for sending SMS via the Ultimate SMS HTTP API.
Installation
composer require frolax/ultimate-sms-notification-channel
Publish the config file:
php artisan vendor:publish --provider="UltimateSmsNotificationChannel\\UltimateSmsServiceProvider" --tag=config
Configuration
Add the following to your .env
:
ULTIMATE_SMS_BASE_URL=https://sms.frolax.net
ULTIMATE_SMS_API_KEY=your_api_key
ULTIMATE_SMS_SENDER_ID=YourName
ULTIMATE_SMS_DLT_TEMPLATE_ID=optional
ULTIMATE_SMS_BASE_URL
should be the website base URL only (e.g.,https://sms.frolax.net
).- The package will automatically use the correct API endpoint for sending SMS.
Usage
In your notification:
use UltimateSmsNotificationChannel\UltimateSmsMessage; public function via($notifiable) { return ['ultimate_sms']; } public function toUltimateSms($notifiable) { return (new UltimateSmsMessage()) ->content('This is a test message'); }
Or route notification:
use Illuminate\Support\Facades\Notification; use App\Notifications\YourNotification; Notification::route('ultimate_sms', '31612345678')->notify(new YourNotification());
Sending to Multiple Recipients
You can send to multiple numbers by passing a comma-separated string:
UltimateSmsMessage::create('This is a test message') ->to('31612345678,880172145789');
Using the Facade Directly
You can send an SMS directly using the facade if you want to bypass Laravel's notification system:
use UltimateSmsNotificationChannel\Facades\UltimateSms; UltimateSms::send([ 'recipient' => '+8801322635808', 'message' => 'Hello', 'sender_id' => 'HaQuick', 'type' => 'plain', ]);
Optional Parameters
sender_id
: Override the default sender ID.type
: Set the message type (default:plain
).schedule_time
: Schedule the SMS (format:YYYY-MM-DD HH:MM
).dlt_template_id
: Set a DLT template ID (optional).
Testing
vendor/bin/pest