hcipl/dropzone-with-dropbox

Dropzone 文件上传与 Dropbox

安装: 0

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:laravel-module

dev-master 2023-06-14 12:22 UTC

This package is auto-updated.

Last update: 2024-10-03 10:37:23 UTC


README

使用 Dropbox 进行 Dropzone 文件上传。

实时链接 : (https://packagist.org.cn/packages/hcipl/dropzone-with-dropbox)

使用方法

  1. 安装包: "composer require hcipl/dropzone-with-dropbox".
  2. 配置数据库 ".env" 文件。
  3. 首先,您需要在 Dropbox 获取一个授权令牌。与其他公司不同,Dropbox 使这一过程变得非常简单。您只需在 应用控制台 为任何 Dropbox API 应用生成令牌。更多信息请参阅 Dropbox 开发者博客
  4. 在 .env 文件中设置 Dropbox 配置
  5. 在 AppServiceProvider.php 中将 Dropbox 配置为驱动程序
    public function boot()
    {
    	
        Storage::extend('dropbox', function (Application $app, array $config) {

            $adapter = new DropboxAdapter(new DropboxClient(
                $config['authorization_token']
            ));
   
            return new FilesystemAdapter(
                new Filesystem($adapter, $config),
                $adapter,
                $config
            );
        });
    }
  1. 在 config/filesystems.php 中的 "disks" 下添加一个新的驱动程序。
	'dropbox' => [
        'driver' => 'dropbox',
        'key' => env('DROPBOX_APP_KEY'),
        'secret' => env('DROPBOX_APP_SECRET'),
        'authorization_token' => env('DROPBOX_AUTHORIZATION_TOKEN', null),
        'case_sensitive' => true,
    ]
  1. 运行迁移: "php artisan migrate"
  2. 运行项目服务器 "php artisan serve",
  3. 测试 URL "http://127.0.0.1:8000/image/index"

视图修改

为了修改 dropzone
  1. 选择 "Provider:Hcipl\dropzoneWithDropbox\DropzoneWithDropboxServiceProvider" 选项。
  2. 运行以下命令发布资源。php artisan vendor:publish --tag=public --force