cyberwolfstudio/laravel-smsmapi-notifications
Composer 安装命令:
composer require cyberwolfstudio/laravel-smsmapi-notifications
包简介
SmsAPI Notifications Channel for Laravel
README 文档
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.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-19