Package Data | |
---|---|
Maintainer Username: | jaychan |
Maintainer Contact: | voidea@foxmail.com (jaychan) |
Package Create Date: | 2015-08-05 |
Package Last Update: | 2015-08-05 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-18 03:02:25 |
Package Statistics | |
---|---|
Total Downloads: | 22 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 5 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
composer require jaychan/laravel-alioss
ServiceProvider
到您项目 config/app.php
中的 providers
部分:JayChan\Aliyun\OSS\ServiceProvider::class,
php artisan vendor:publish
请修改应用根目录下的 config/alioss.php
中对应的项即可;
(可选)添加外观到 config/app.php
中的 aliases
部分:
'AliyunOSS' => JayChan\Aliyun\OSS\Facade::class,
// 设置Bucket
AliyunOSS::setBucket('my-bucket');
// 上传文件
AliyunOSS::uploadFile('key', $file = '/path/to/your/file', $bucket = null);
// 上传内容
AliyunOSS::uploadContent('key', $content = 'content', $bucket = null);
// 设置Bucket前缀
AliyunOSS::setBucketPrefix('prefix_');
// 获取资源请求URL
AliyunOSS::getUrl($key, $expire = 3600, $bucket = null);
MIT