青牛云上传
composer require itbdw/laravel-storage-qiniu
itbdw\QiniuStorage\QiniuFilesystemServiceProvider::class,
'qiniu' => [
'driver' => 'qiniu',
'domain' => '', //你的七牛域名
'access_key'=> '', //AccessKey
'secret_key'=> '', //SecretKey
'bucket' => '', //Bucket名字,即七牛云存储空间名称
],
public function fileAdd(){
$disk = \Storage::disk('qiniu'); //使用七牛云上传
$time = date('Y-m-d');
$filename = $disk->put($time, request()->file('image'));//上传 这里的image是前端的name值,自己来定
if(!$filename) {
echo "上传失败";
}
$img_url = $disk->getDriver()->downloadUrl($filename); //获取下载链接
echo $img_url;
}