PHP code example of bkqw / mes

1. Go to this page and download the library: Download bkqw/mes library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bkqw / mes example snippets


1. composer san vendor:publish 
   选择 Bkqw\Mes\Providers\MesServiceProvider 
   该命令会在config目录下生成mes.php配置文件,请根据实际情况修改配置
3. 你可以这样调用: 
        use Bkqw\Mes\MesAction;
        app()->make(MesAction::class)->send($mobile, $content, $type, $method);
   也可以使用门面:
        use Bkqw\Mes\Facades\MesAction; 
        MesAction::send($mobile, $content, $type, $method);        



namespace App\Http\Controllers;

use Bkqw\Mes\Facades\MesAction;

class MesController extends Controller
{
    public function send()
    {
        try{
            $mobile = ['your mobile 1', 'your mobile 2', '...'];
            $content = '【八块钱网】下午好';
            $type = 'yx';
            $method = 'sendGWMsg';
            $res = MesAction::send($mobile, $content, $type, $method);
        }catch (\Exception $e){
            return $e->getMessage();
        }
        return $res;
    }
}