spatie/flysystem-dropbox
Flysystem adapter for Dropbox using Dropbox API v2. Connect via an authorization token and use the Spatie Dropbox client with a Flysystem Filesystem. Supports modern Flysystem versions (v2/3); see v1 branch for Flysystem v1.
Pros:
Storage facade).Cons:
Storage facade via Flysystem’s FilesystemManager.config/filesystems.php (e.g., dropbox driver).'dropbox' => [
'driver' => 'dropbox',
'key' => env('DROPBOX_KEY'),
'secret' => env('DROPBOX_SECRET'),
'token' => env('DROPBOX_TOKEN'),
'team_id' => env('DROPBOX_TEAM_ID'), // Optional for team accounts
],
league/flysystem (≥v2.0) and dropbox/dropbox-sdk (v2)./files endpoint changes) could break functionality. Monitor Dropbox’s changelog..env or a secrets manager).mockery or vcr (e.g., VCR for PHP).spatie/flysystem-dropbox + Redis).filesystem disks (e.g., local, s3) with dropbox.Storage facade for CLI operations (e.g., php artisan storage:link equivalent).dropbox:upload job).Filesystem class, but loses Laravel’s conveniences (e.g., facades, config caching).dropbox_backup) to test integration.$filesystem = Storage::disk('dropbox')->put('file.txt', 'content');
Storage::get(), Storage::delete()) with Dropbox-specific logic where needed.url() method for shared links:
$client = app(DropboxClient::class);
$sharedLink = $client->sharedLinks()->createSharedLinkWithSettings('/path/to/file');
dropbox for critical paths.config/filesystems.php and .env.spatie/laravel-caching).spatie/flysystem-dropbox and dropbox/dropbox-sdk regularly (watch for breaking changes).'dropbox' => [
'debug' => env('APP_DEBUG'), // Enable SDK logging
],
afterCommit()).flysystem-cache package).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Dropbox API downtime | File operations fail | Implement retry logic with exponential backoff. |
| Token expiration | Authentication failures | Auto-refresh tokens via cron or queue job. |
| Rate limiting | Slow performance or timeouts | Cache metadata; use chunked operations. |
| Network partition | Timeouts for remote operations | Queue jobs with dead-letter queues. |
| Dropbox quota exceeded | Upload failures | Monitor usage; implement fallback storage. |
| Team member revokes access | App permissions lost | Use service account (if available) or alert admins. |
How can I help you explore Laravel packages today?