overnic / laravel-aliyun-oss by overnic

Aliyun oss for Laravel5, also support flysystem adapter
30
0
2
Package Data
Maintainer Username: overnic
Maintainer Contact: overnic@httpd.cc (overnic)
Package Create Date: 2017-04-12
Package Last Update: 2017-06-26
Language: PHP
License: MIT
Last Refreshed: 2024-11-22 03:04:05
Package Statistics
Total Downloads: 30
Monthly Downloads: 1
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Aliyun OSS adapter

Aliyun oss for Laravel5, also support flysystem adapter.

Installation

This package can be installed through Composer.

composer require overnic/laravel-aliyun-oss

This service provider must be registered.

// config/app.php

'providers' => [
    '...',
    'Overnic\AliyunOss\AliyunOssServiceProvider',
];

At last, you can edit the config file: config/filesystem.php.

add a disk config to the config

'oss' => [
    'driver'       => 'oss',
  	'access_id'    => 'Your oss access id',
  	'access_key' 	 => 'Your oss access key',
  	'bucket' 	     => 'Your project bucket on oss',
  	'endpoint'     => '', // 青岛节点需要指定,杭州节点不需要
    'prefix'       => ''  // Path prefix, default can keep empty
],

change default to oss

'default' => 'oss';

Usage

You can now use Laravel5's flysystem to upload or get file/directory from oss, follow the document, http://laravel.com/docs/5.0/filesystem