cyberwolfstudio / laravel-smsmapi-notifications
SmsAPI Notifications Channel for Laravel
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/cyberwolfstudio/laravel-smsmapi-notifications
Requires
- php: >=7.2
- illuminate/notifications: ~6.0 || ~7.0 || ~8.0 || ~9.0 || ~10.0 || ^11.0 || ^12.0
- illuminate/support: ~6.0 || ~7.0 || ~8.0 || ~9.0 || ~10.0 || ^11.0 || ^12.0
- smsapi/php-client: ^1.8 || ^3.0
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^8.0 || ^10.5
This package is auto-updated.
Last update: 2026-02-19 15:06:53 UTC
README
Laravel notification channel for sending SMS via SmsAPI. Supports both Polish (smsapi.pl) and international (smsapi.com) services.
Compatible with Laravel 6.x through 12.x.
Installation
composer require cyberwolfstudio/laravel-smsmapi-notifications
The service provider is auto-discovered. No manual registration needed.
Configuration
Add your SmsAPI token to config/services.php:
'smsapi' => [ 'token' => env('SMSAPI_AUTH_TOKEN'), ],
Optionally set the service region in config/smsapi.php:
// 'pl' (default) or 'com' 'service' => env('SMSAPI_SERVICE', 'pl'),
Usage
Implement the SmsAPINotification contract on your notification and return an SmsAPIMessage:
use Illuminate\Notifications\Notification; use CyberWolfStudio\LaravelSmsAPINotifications\SmsAPIPlChannel; use CyberWolfStudio\LaravelSmsAPINotifications\SmsAPIMessage; use CyberWolfStudio\LaravelSmsAPINotifications\Contracts\SmsAPINotification; class OrderShipped extends Notification implements SmsAPINotification { public function via($notifiable): array { return [SmsAPIPlChannel::class]; } public function toSmsAPI($notifiable): SmsAPIMessage { return new SmsAPIMessage('Your order has been shipped!'); } }
Routing
Add a routeNotificationForSmsapi method to your notifiable model to return the phone number:
public function routeNotificationForSmsapi(): string { return $this->phone_number; }
To send to a contacts group instead, add routeNotificationForSmsapiGroup:
public function routeNotificationForSmsapiGroup(): string { return $this->contacts_group; }
License
The MIT License (MIT). Please see License File for more information.