| 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: | 2025-10-29 03:02:33 |
| Package Statistics | |
|---|---|
| Total Downloads: | 25 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 5 |
| Total Watchers: | 1 |
| 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