Looking to hire Laravel developers? Try LaraJobs

laravel-sms maintained by huangdijia

Description
sms for laravel
Author
Last update
2020/11/24 11:13 (dev-master)
License
Downloads
6 983
Tags

Comments
comments powered by Disqus

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