huangdijia/laravel-twsms

1.0.3 2019-09-04 05:48 UTC

This package is auto-updated.

Last update: 2024-12-05 19:01:34 UTC


README

Latest Stable Version Total Downloads

Requirements

  • PHP >= 7.0
  • Laravel >= 5.5

Installation

composer require huangdijia/laravel-twsms

Publish

php artisan vendor:publish --provider="Huangdijia\Twsms\Providers\TwsmsServiceProvider"

Configure

TWSMS_ACCOUNT=account
TWSMS_PASSWORD=password
TWSMS_TYPE=now
TWSMS_ENCODING=big5
TWSMS_VLDTIME=
TWSMS_DLVTIME=

Usage

Command

php artisan twsms:send [mobile] [message]

Facade

Huangdijia\Twsms\Facades\Twsms::send($mobile, $message);

Container

app('sms.twsms')->send($mobile, $message);

Error

$twsms = app('sms.twsms');

if (!$twsms->send($mobile, $message)) {
    dd($twsms->getError());
}