Skip to content

huangdijia/laravel-sms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel-sms

Latest Stable Version Total Downloads GitHub license

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();

About

All in one, sms for laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages