| Package Data | |
|---|---|
| Maintainer Username: | kechujian | 
| Package Create Date: | 2018-09-04 | 
| Package Last Update: | 2018-10-26 | 
| Language: | PHP | 
| License: | MIT | 
| Last Refreshed: | 2025-11-03 15:08:22 | 
| Package Statistics | |
|---|---|
| Total Downloads: | 32 | 
| Monthly Downloads: | 0 | 
| Daily Downloads: | 0 | 
| Total Stars: | 1 | 
| Total Watchers: | 1 | 
| Total Forks: | 0 | 
| Total Open Issues: | 0 | 
Install the Laravel framework or the Lumen framework.
Create a Laravel or Lumen project, depending on the framework you have installed.
In the composer.json file of the new project, insert the following code:
{
    "require": {
        "kechujian/aliyun-oss-sdk-laravel": "~1.0.0"
    }
}
Run the following command: composer update
Edit the vendor/aliyun-oss/aliyun-oss-php-sdk-laravel/config/config.php file as follows:
return [
    'id' => 'your id',
    'key' => 'your key',
    'endpoint' => 'your endpoint',
    'bucket' => 'your bucket',
    'iscname' => true or false
];
Edit the config/app.php file and register OSS Service Provider:
'providers' => array(
    // ...
    AliyunOss\Laravel\AliyunOssServiceProvider::class,
)
Edit the config/app.php file to insert an aliases segment.
'aliases' => array(
    // ...
    'OSS' => AliyunOss\Laravel\AliyunOssFacade::class,
)
Edit the routes/web.php file as follows:
Route::get('/', function()
{
    $client = App::make('aliyun-oss');
    $client->putObject("your bucket", "your object", "content you want to upload");
    $result = $client->getObject("your bucket", "your boject");
    echo $result;
});
Edit the vendor/aliyun-oss/aliyun-oss-php-sdk-laravel/config/config.php file as follows:
return [
    'id' => 'your id',
    'key' => 'your key',
    'endpoint' => 'your endpoint',
    'bucket' => 'your bucket',
    'iscname' => true or false
];
Edit the bootstrap/app.php file and register OSS Service Providers:
$app->register(AliyunOss\Laravel\AliyunOssServiceProvider::class);
Edit the routes/web.php file as follows:
$app->get('/', function () use ($app) {
    $client = $app->make('aliyun-oss');
    $client->putObject('your bucket', 'your key',  "content you want to upload");
    $result = $client->getObject("your bucket", "your boject");
    echo $result;
});
export OSS_ENDPOINT=''
export OSS_ACCESS_KEY_ID=''
export OSS_ACCESS_KEY_SECRET=''
export OSS_BUCKET=''
php vendor/bin/phpunit