huangdijia/laravel-accessyou

1.2.0 2020-10-10 03:17 UTC

README

Latest Stable Version Total Downloads

Requirements

  • PHP >= 7.0
  • Laravel >= 5.5

Installation

First, install laravel 5.5, and make sure that the database connection settings are correct.

composer require huangdijia/laravel-accessyou

Then run these commands to publish config

php artisan vendor:publish --provider="Huangdijia\Accessyou\AccessyouServiceProvider"

Configurations

// config/accessyou.php
    'account'  => 'your account',
    'password' => 'your password',

Usage

As Facade

use Huangdijia\Accessyou\Facades\Accessyou;

...

if (!Accessyou::send('mobile', 'some message')) {
    echo Accessyou::getError();
    echo Accessyou::getErrno();
} else {
    echo "send success";
}

As Command

php artisan accessyou:send 'mobile' 'some message'
# send success
# or
# error

As Helper

if (!accessyou()->send('mobile', 'some message')) {
    echo accessyou()->getError();
    echo accessyou()->getErrno();
} else {
    echo "send success";
}
if (!$error = accessyou_send('mobile', 'some message')) {
    echo $error;
} else {
    echo "send success";
}

Other

License

laravel-access is licensed under The MIT License (MIT).