PHP code example of bmslaravel / aliyun-sts

1. Go to this page and download the library: Download bmslaravel/aliyun-sts 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/ */

    

bmslaravel / aliyun-sts example snippets

 
        $app->withFacades(true, [
            // ...
            Helium\Sts\Facades\AliYunSTS::class => 'AliYunSTS',
        ]);
       

    try{
        $response = Helium\Sts\Facades\AliYunSTS::token();
        dd($response);
        // or
        $config = config('sts');
        $response = (new Helium\Sts\Sts($config))->token();
        dd($response);
        // or
        $response = app('aliyun.sts')->token();
        dd($response);
    } catch (\Exception $exception) {
        dd($exception);
    }