Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/larvatecn/laravel-flysystem-cos
Tencent Cloud COS SDK for Laravel
https://github.com/larvatecn/laravel-flysystem-cos
laravel php
Last synced: 12 days ago
JSON representation
Tencent Cloud COS SDK for Laravel
- Host: GitHub
- URL: https://github.com/larvatecn/laravel-flysystem-cos
- Owner: larvatecn
- License: mit
- Created: 2021-02-19T12:50:11.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-10T07:35:45.000Z (almost 2 years ago)
- Last Synced: 2024-11-22T17:12:59.797Z (about 1 month ago)
- Topics: laravel, php
- Language: PHP
- Size: 34.2 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-flysystem-cos
适用于 Laravel 的腾讯云 COS 适配器,完整支持腾讯云 COS 所有方法和操作。
## 安装
```bash
composer require larva/laravel-flysystem-cos -vv
```修改配置文件: `config/filesystems.php`
添加一个磁盘配置
```php
'cos' => [
'driver' => 'cos',
// 'endpoint' => getenv('TENCENT_COS_ENDPOINT'),//接入点,留空即可
'region' => env('TENCENT_COS_REGION'),
'credentials' => [//认证凭证
'appId' => env('TENCENT_COS_APP_ID'),//就是存储桶的后缀 如 1258464748
'secretId' => env('TENCENT_COS_SECRET_ID'),
'secretKey' => env('TENCENT_COS_SECRET_KEY'),
'token' => env('TENCENT_COS_TOKEN'),
],
'bucket' => env('TENCENT_COS_BUCKET'),
'root' => getenv('COS_PREFIX'),//前缀
'url'=> env('TENCENT_COS_URL'),//CDN URL
//以下均可省略
'schema' => 'https',
'timeout' => 3600,
'connect_timeout' => 3600,
'ip' => null,
'port' => null,
'domain' => null,
'proxy' => null,
'encrypt'=> null,
],
```修改默认存储驱动
```php
'default' => 'cos'
```## 使用方法
参见 [Laravel wiki](https://laravel.com/docs/9.x/filesystem)