1、首先composer?
composer require zgldh/qiniu-laravel-storage:0.10.3
2、接下来修改配置在?config/filesystems.php ?添加一项: “****”为必填
'disks' => [
... ,
'qiniu' => [
'driver' => 'qiniu',
'domains' => [
'default' => '****/', //你的七牛域名
'https' => '', //你的HTTPS域名
'custom' => '', //你的自定义域名
],
'access_key'=> '****', //AccessKey
'secret_key'=> '****', //SecretKey
'bucket' => '****', //Bucket名字
'notify_url'=> '', //持久化处理回调地址
'url' => '****/', // 填写文件访问根url
],
],
3、然后修改?dcat-admin ?的上传配置,打开?config/admin.php ?找到:
'upload' => [
'disk' => 'qiniu',
'directory' => [
'image' => 'image',
'file' => 'file',
],
],
4、disk ?选择上面配置的?qiniu ,或:
$form->file('file')->disk('qiniu');
|