PHP code example of xutl / laravel-aliyun

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

    

xutl / laravel-aliyun example snippets


// config/app.php

'providers' => [
    '...',
    XuTL\Aliyun\AliyunServiceProvider::class,
];

try {
	$aliyun = Aliyun::get('cdn');
	$cdn->RefreshObjectCaches([
		'ObjectPath' => [
			'http://www.baidu.com',
		],
		'ObjectType' => 'File'
	]);
} catch (\Exception $e) {
	print_r($e->getMessage());
}