Skip to content

Commit 8d65999

Browse files
committed
Laravel 9
1 parent af8c894 commit 8d65999

File tree

2 files changed

+33
-39
lines changed

2 files changed

+33
-39
lines changed

README.md

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Laravel filesystem COS
1+
# Laravel filesystem COS
22

33
[Tencent Cloud COS](https://cloud.tencent.com/product/cos) storage for Laravel based on [overtrue/flysystem-cos](https://github.com/overtrue/flysystem-cos).
44

55
[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me-button-s.svg?raw=true)](https://github.com/sponsors/overtrue)
66

77
# Requirement
88

9-
- PHP >= 7.4
9+
- Laravel >= 9.0
1010

1111
# Installation
1212

@@ -18,37 +18,35 @@ $ composer require "overtrue/laravel-filesystem-cos" -vvv
1818

1919
1. Add a new disk to your `config/filesystems.php` config:
2020

21-
🚨 当前为 v2 版本,v2 和 v1 在配置写法上有差异,升级请注意。
22-
23-
```php
24-
<?php
25-
26-
return [
27-
'disks' => [
28-
//...
29-
'cos' => [
30-
'driver' => 'cos',
31-
32-
'app_id' => env('COS_APP_ID'),
33-
'secret_id' => env('COS_SECRET_ID'),
34-
'secret_key' => env('COS_SECRET_KEY'),
35-
'region' => env('COS_REGION', 'ap-guangzhou'),
36-
37-
'bucket' => env('COS_BUCKET'), // 不带数字 app_id 后缀
38-
'cdn' => env('COS_CDN'),
39-
'signed_url' => false,
40-
41-
'prefix' => env('COS_PATH_PREFIX'), // 全局路径前缀
42-
43-
'guzzle' => [
44-
'timeout' => env('COS_TIMEOUT', 60),
45-
'connect_timeout' => env('COS_CONNECT_TIMEOUT', 60),
46-
],
47-
],
48-
//...
49-
]
50-
];
51-
```
21+
```php
22+
<?php
23+
24+
return [
25+
'disks' => [
26+
//...
27+
'cos' => [
28+
'driver' => 'cos',
29+
30+
'app_id' => env('COS_APP_ID'),
31+
'secret_id' => env('COS_SECRET_ID'),
32+
'secret_key' => env('COS_SECRET_KEY'),
33+
'region' => env('COS_REGION', 'ap-guangzhou'),
34+
35+
'bucket' => env('COS_BUCKET'), // 不带数字 app_id 后缀
36+
'cdn' => env('COS_CDN'),
37+
'signed_url' => false,
38+
39+
'prefix' => env('COS_PATH_PREFIX'), // 全局路径前缀
40+
41+
'guzzle' => [
42+
'timeout' => env('COS_TIMEOUT', 60),
43+
'connect_timeout' => env('COS_CONNECT_TIMEOUT', 60),
44+
],
45+
],
46+
//...
47+
]
48+
];
49+
```
5250

5351
> 🚨 请注意:example-1230000001.cos.ap-guangzhou.mycloud.com
5452
>
@@ -77,20 +75,16 @@ $disk->move('old/file1.jpg', 'new/file1.jpg');
7775

7876
// get file contents
7977
$contents = $disk->read('folder/my_file.txt');
80-
81-
// get file url
82-
$url = $disk->getUrl('folder/my_file.txt');
8378
```
8479

8580
[Full API documentation.](http://flysystem.thephpleague.com/api/)
8681

87-
## :heart: Sponsor me
82+
## :heart: Sponsor me
8883

8984
[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me.svg?raw=true)](https://github.com/sponsors/overtrue)
9085

9186
如果你喜欢我的项目并想支持它,[点击这里 :heart:](https://github.com/sponsors/overtrue)
9287

93-
9488
## Project supported by JetBrains
9589

9690
Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.
@@ -103,7 +97,6 @@ Many thanks to Jetbrains for kindly providing a license for me to work on this a
10397
>
10498
> 请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— [《PHP 扩展包实战教程 - 从入门到发布》](https://learnku.com/courses/creating-package)
10599
106-
107100
# License
108101

109102
MIT

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "overtrue/laravel-filesystem-cos",
33
"description": "A Cos storage filesystem for Laravel.",
44
"require": {
5+
"laravel/framework": "^9.0",
56
"overtrue/flysystem-cos": "^5.0.0"
67
},
78
"require-dev": {

0 commit comments

Comments
 (0)