PHP code example of surpaimb / laravel-admin-alioss

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

    

surpaimb / laravel-admin-alioss example snippets


'extensions' => [
        'alioss-upload' => [
            'OSS_ACCESS_ID' => '*****',
            'OSS_ACCESS_KEY' => '**************',
            'OSS_ENDPOINT' => 'oss-cn-shanghai.aliyuncs.com',
            'OSS_BUCKET' => '*****',
            'OSS_HOST' => 'http://****.oss-cn-shanghai.aliyuncs.com',
            'OSS_URL' => 'http://***.oss-cn-shanghai.aliyuncs.com' // 自定义域名(CDN)
        ]
    ],

$form->aliOss('pic', '图片')->attribute('image');  // 单图(默认)
$form->aliOss('pic2', '图片2')->attribute('images'); // 多图
$form->aliOss('pic3', '图片2')->attribute('file'); // 多图