PHP code example of abe / laravel-mns

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

    

abe / laravel-mns example snippets


'connections' => [
    'redis' => [
        'driver'     => 'redis',
        'connection' => 'default',
        'queue'      => 'default',
        'expire'     => 60,
    ],

    // 新增阿里云 MNS。
    'mns'   => [
        'driver'   => 'mns',
        'key'      => env('MNS_ACCESS_KEY', 'access-key'),
        'secret'   => env('MNS_SECRET_KEY', 'secret-key'),
        // 外网连接必须启用 https。
        'endpoint' => 'your-endpoint',
        'queue'    => env('MNS_DEFAULT_QUEUE', 'default-queue-name'),
    ],
],

Queue::extend('mns', function()
{
    return new \LaravelMns\Connectors\MnsConnector();
});