hcipl/dropzone-with-dropbox

Dropzone file upload with dropbox

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

This package is auto-updated.

Last update: 2024-05-03 09:48:29 UTC


README

Dropzone file upload with dropbox.

Live url : (https://packagist.org/packages/hcipl/dropzone-with-dropbox)

Usage

  1. Install the package: "composer require hcipl/dropzone-with-dropbox".
  2. Configure your database ".env" file.
  3. The first thing you need to do is get an authorization token at Dropbox. Unlike other companies Dropbox has made this very easy. You can just generate a token in the App Console for any Dropbox API app. You'll find more info at the Dropbox Developer Blog.
  4. Set dropbox configuration on your .env file
  5. Configure Dropbox as Driver in AppServiceProvider.php
    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. Add a new driver on the config/filesystems.php inside "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. Run migration: "php artisan migrate"
  2. Run project server "php artisan serve",
  3. Test url "http://127.0.0.1:8000/image/index"

Views Modification

In order to modify the dropzone:
  1. Select the option which depicts "Provider:Hcipl\dropzoneWithDropbox\DropzoneWithDropboxServiceProvider".
  2. Run below command to publish the assests. php artisan vendor:publish --tag=public --force