Download the PHP package smsaero/smsaero_laravel without Composer
On this page you can find all versions of the php package smsaero/smsaero_laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smsaero/smsaero_laravel
More information about smsaero/smsaero_laravel
Files in smsaero/smsaero_laravel
Package smsaero_laravel
Short Description Laravel integration for the SmsAero API: facade, DI, notification channel.
License MIT
Informations about the package smsaero_laravel
PHP Laravel library for sending SMS messages via SMS Aero API
Laravel integration for the SmsAero API: facade, dependency injection, and a queueable notification channel on top of the smsaero/smsaero_api library.
Documentation in Russian: README.RUS.md
Installation (from Packagist):
The service provider and SmsAero facade are registered automatically via package discovery.
Configuration:
Publish the configuration file:
Set credentials in .env. Get them from the account settings page: https://smsaero.ru/cabinet/settings/apikey/
Usage example:
Facade
Available domain clients: message(), contact(), group(), user(), viber(), whatsapp(), telegram(), mobileId().
High-level send (typed)
sendSms() fills sign from config, normalizes the response, throws typed exceptions and returns a SmsAeroResult:
On success=false it throws ApiException; on a transport failure, ConnectionException.
Strict mode
guard() runs every domain call through response normalization and typed exceptions:
The raw passthrough SmsAero::message()->send([...]) (returns array, throws the base \Exception) is kept for backward compatibility.
Dependency injection
Notification channel
The recipient number is resolved from routeNotificationForSmsAero(), then the sms channel route, then the phone / phone_number attribute:
Queueing
Add implements ShouldQueue to the notification to deliver it through a queue:
Testing:
SmsAero::fake() swaps the client with a recording double and exposes assertions:
Exceptions:
The notification channel throws typed exceptions:
SmsAero\Laravel\Exceptions\SmsAeroException— base exception for all exceptions raised by the package.SmsAero\Laravel\Exceptions\ConnectionException— network failure, gate unavailability, empty or malformed response. Retryable by the queue.SmsAero\Laravel\Exceptions\ApiException— API rejection (success=false). The full response body is available on$exception->response.
Direct facade/DI calls return arrays and raise the base \Exception from the smsaero/smsaero_api library.
Security:
- Credentials are read only from
env()insideconfig/smsaero.php. php artisan config:cachebakes the values intobootstrap/cache/config.php— do not ship that file in a Docker image together with a real.env; provide secrets through runtime mechanisms (Docker/K8s secrets, Vault).- Add
api_key,apiKey,authorization,SMSAERO_*to your Sentry/log scrubber and mask phone numbers. - Validate
callbackUrl(Mobile ID) on the application side (https only, trusted host) — it is a potential SSRF vector.
Compatibility:
- PHP 8.1+
- Laravel 10, 11, 12
License:
All versions of smsaero_laravel with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/notifications Version ^10.0|^11.0|^12.0
smsaero/smsaero_api Version ^1.2