expertsystemsau/transmitsms-laravel-client
最新稳定版本:v1.4.0
Composer 安装命令:
composer require expertsystemsau/transmitsms-laravel-client
包简介
Laravel notification channel and integration for the TransmitSMS API
README 文档
README
Laravel notification channel and integration for the TransmitSMS API.
Installation
composer require expertsystemsau/transmitsms-laravel-client
Publish the configuration file:
php artisan vendor:publish --tag="transmitsms-config"
Configuration
Add your credentials to your .env file:
TRANSMITSMS_API_KEY=your-api-key TRANSMITSMS_API_SECRET=your-api-secret TRANSMITSMS_FROM=YourSenderID
Usage
Facade
use ExpertSystems\TransmitSms\Laravel\Facades\TransmitSms; // Send an SMS TransmitSms::sendSms('+61400000000', 'Hello from Laravel!'); // Get account balance $balance = TransmitSms::getBalance();
Notifications
Create a notification that uses the TransmitSMS channel:
use Illuminate\Notifications\Notification; use ExpertSystems\TransmitSms\Laravel\Notifications\TransmitSmsMessage; class OrderShipped extends Notification { public function via($notifiable): array { return ['transmitsms']; } public function toTransmitSms($notifiable): TransmitSmsMessage { return (new TransmitSmsMessage()) ->content('Your order has been shipped!') ->from('MyStore'); } }
Add the routeNotificationForTransmitsms method to your notifiable model:
class User extends Authenticatable { use Notifiable; public function routeNotificationForTransmitsms($notification): ?string { return $this->phone_number; } }
Then send notifications:
$user->notify(new OrderShipped());
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-09