huangdijia / laravel-sms
sms for laravel
Installs: 4 849
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.2.0
- alibabacloud/client: ^1.5
- guzzlehttp/guzzle: ^6.4|^7.0
- illuminate/contracts: ^7.0|^8.0
- illuminate/notifications: ^7.0|^8.0
- illuminate/support: ^7.0|^8.0
Requires (Dev)
- orchestra/testbench: ^5.0
README
Installation
Install package
composer require huangdijia/laravel-sms
Install configure
php artisan sms:install
Uage
Simple to send a message
use Huangdijia\Sms\Facades\Sms; Sms::to('phone number')->content('message content')->send();
Check send result
$response = Sms::to('phone number')->content('message content')->send(); if ($response->successful()) { // success }
Throwing Exceptions
$response = Sms::to('phone number')->content('message content')->send(); $response->throw();
Switch sms factory
Sms::use('another')->to('phone number')->content('message content')->send();
With Validate Rules
Sms::withRules([ 'to' => 'required|numeric|....', 'content' => 'required|...', ], [ 'to.required' => ':attribute cannot be empty!', 'content.required' => ':attribute cannot be empty!', // more messages ])->to()->content()->send();