altrntv / sms-aero
SMS AERO Notifications channel for Laravel.
v1.0.0
2026-06-26 06:46 UTC
Requires
- php: ^8.3
- illuminate/http: ^11.0|^12.0|^13.0
- illuminate/notifications: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^2.0|^3.0|^4.0
- pestphp/pest-plugin-laravel: ^2.0|^3.0|^4.0
README
This package makes it easy to send notifications using smsaero.ru with Laravel.
Contents
Installation
Install this package with Composer:
composer require altrntv/sms-aero
Setting up the Sms Aero service
Add your Sms Aero Api ID and Host to your config/services.php:
... 'sms-aero' => [ 'username' => env('SMS_AERO_USERNAME'), 'password' => env('SMS_AERO_PASSWORD'), 'host' => env('SMS_AERO_HOST', 'https://gate.smsaero.ru/v2'), ], ...
Usage
You can use the channel in your via() method inside the notification:
use NotificationChannels\SmsAero\SmsAeroMessage; use NotificationChannels\SmsAero\SmsAeroChannel; use Illuminate\Notifications\Notification; class OrderStatus extends Notification { public function via(mixed $notifiable): array { return [ SmsAeroChannel::class, // or 'sms-aero', ]; } public function toSmsAero(mixed $notifiable): SmsAeroMessage { return SmsAeroMessage::create('Message', 'Sender Name'); } }
In your notifiable model, make sure to include a routeNotificationForSmsAero() method, which returns a phone number or
an array of phone numbers.
public function routeNotificationForSmsAero(): ?string { return $this->phone; }
Available Message methods
| Method | Description |
|---|---|
number(string $number) |
Set a phone number. |
dateSend(int $dateSend) |
The date for the delayed sending of the message in unixtime format. |
callbackUrl(string $callbackUrl) |
The URL for sending the message status in the format https://your.site in response, the system waits for the 200 status. |
callbackFormat(string $callbackFormat) |
If callbackFormat=JSON is set, data in JSON format will be sent to callbackUrl, otherwise x-www-form-urlencoded is used. |
shortLink(?int $shortLink) |
If shortLink=1, all links will be shortened automatically. |
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email sssecularization@gmail.com instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.