PHP code example of ibrand / laravel-express

1. Go to this page and download the library: Download ibrand/laravel-express 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/ */

    

ibrand / laravel-express example snippets


php artisan vendor:publish --provider="iBrand\Express\ServiceProvider"

'route' => [
	'prefix' => 'express',
	'middleware' => ['web'],
],
//or
'route' => [
	'prefix' => 'express',
	'middleware' => ['api'],
],

use Express;

Express::query(request('no'));

use Express;

Express::query((request('no'), ['aliyun']); // 这里的网关配置将会覆盖全局默认,需要在配置文件中配置好相关项

use Express;

Express::query((request('no'), ['aliyun'=>[
    'app_key' => '',
    'app_secret' => '',
    'app_code' => '',
]]);

use Express;

$number = '810597623758';

Express::query($number, ['kuaidi100']); // 这里的网关配置将会覆盖全局默认值

[
    'kuaidi100' => [
        'gateway' => 'kuaidi100',
        'status' => 'success',
        'result' => [...] // 平台返回值
    ],
    'aliyun' => [
        'gateway' => 'aliyun',
        'status' => 'failure',
        'exception' => \Exception 对象
    ],
    //...
]

    'kuaidi100' => [
        'key' => '',
        'customer' => '',
        'secret' => '',
        'sms_user_id' => ''
    ],