前言:
其实我也是看的别人的,整理出一套自己可以直接使用的代码和开发步骤,我可以用,不代表你可以用,所以如果不能用请自己爬坑。
配置:
在 composer.json 文件的 require 中 添加 一句 :
"caojianfei/laravel-qcloud-cos": "^1.0"
然后执行命令:更新一下依赖
composer update
修改一下:config\filesystems.php 文件: (直接替换就可以)
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'qcloud-cos'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|---------------------------------------------------------