hcipl / dropzone-with-dropbox
Dropzone file upload with dropbox
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:laravel-module
Requires
- sawirricardo/laravel-dropbox: ^0.2.0
This package is auto-updated.
Last update: 2024-12-03 11:02:47 UTC
README
Dropzone file upload with dropbox.
Live url : (https://packagist.org/packages/hcipl/dropzone-with-dropbox)
Usage
- Install the package: "composer require hcipl/dropzone-with-dropbox".
- Configure your database ".env" file.
- 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.
- Set dropbox configuration on your .env file
- 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
);
});
}
- 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,
]
- Run migration: "php artisan migrate"
- Run project server "php artisan serve",
- Test url "http://127.0.0.1:8000/image/index"
Views Modification
In order to modify the dropzone:
- Select the option which depicts "Provider:Hcipl\dropzoneWithDropbox\DropzoneWithDropboxServiceProvider".
- Run below command to publish the assests. php artisan vendor:publish --tag=public --force