Download the PHP package tomshaw/laravel-dropbox without Composer
On this page you can find all versions of the php package tomshaw/laravel-dropbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tomshaw/laravel-dropbox
More information about tomshaw/laravel-dropbox
Files in tomshaw/laravel-dropbox
Package laravel-dropbox
Short Description A Laravel Dropbox API client library.
License MIT
Homepage https://github.com/tomshaw/laravel-dropbox
Informations about the package laravel-dropbox
Laravel Dropbox 📂
A Laravel Dropbox API 2.0 client library.
Requirements
- PHP 8.5
- Laravel 13.0
Features
- Secure OAuth 2.0 Flow: Authorization with CSRF
stateverification and PKCE (S256) code challenges out of the box. - Automatic Token Refresh: Expiring tokens are refreshed transparently before every authenticated request — in controllers, queued jobs, and Artisan commands alike.
- Customizable Token Storage: User definable token storage adapters to suit your apps needs. Database-stored tokens are encrypted at rest.
- Static Token Mode: Set
DROPBOX_ACCESS_TOKENto skip the OAuth flow entirely for single-account, server-side integrations. - Large File Support: Uploads above Dropbox's 150 MB single-request limit automatically switch to chunked upload sessions; downloads can stream straight to disk.
- Resilient HTTP Layer: Built on Laravel's HTTP client with configurable timeouts and automatic retries that honor Dropbox
Retry-Afterrate-limit headers. - Typed Exceptions:
DropboxException,AuthenticationException, andRateLimitExceptionexpose the status code and parsederror_summaryfrom Dropbox. - Laravel Facades Integration: Built using Laravel Facades offering a familiar and simple interface that promotes readability, flexibility, testing and ease of use.
Installation
You can install the package via composer:
Next publish the configuration file:
Run the migration if you wish to use database storage adapter:
Configuration
Here's a breakdown of each configuration option:
The following variables should be set in your
.envfile
-
DROPBOX_CLIENT_ID: The client ID for your Dropbox application. -
DROPBOX_CLIENT_SECRET: The client secret for your Dropbox application. -
DROPBOX_REDIRECT_URI: The URI to redirect to after Dropbox authentication. -
DROPBOX_ACCESS_TOKEN: A static access token used for all API requests. When set, the OAuth flow and token storage are bypassed entirely. -
DROPBOX_ACCESS_TYPE: This is the access type for the Dropbox application. -
DROPBOX_ACCESS_SCOPES: If omitted will request all scopes selected on the Permissions tab. -
DROPBOX_TIMEOUT: Request timeout in seconds (default30). DROPBOX_RETRIES: Number of attempts for rate-limited requests or failed connections (default3).
Token storage is configured via the storage key in the published config/dropbox.php. The default is DatabaseTokenStorage (encrypted, requires the migration); SessionTokenStorage is included for session-scoped tokens, or provide your own implementation of TomShaw\Dropbox\Storage\StorageAdapterInterface.
Developers should review the Dropbox Developer Platform and SDK Documentation for further information.
Basic Usage
Below is a cursory explanation of this repository's usage. Please refer to the appropriate Facade Resource for additional methods and usage.
Verify your apps credentials utilizing the
checkaccessorappmethod.Authorizing the application and persisting the token.
Revoking access using the
revokeaccessor.Requesting account information using the
usersaccessor.Creating folders using the
filesaccessor.Downloading files using the
filesaccessor.Large downloads can stream directly to a local path without buffering in memory. The file metadata is returned from the
Dropbox-API-Resultheader.Uploading files using the
filesaccessor. Files above Dropbox's 150 MB single-request limit are automatically sent through a chunked upload session; useuploadSession()to force chunked uploads at any size.Handling Dropbox API errors with typed exceptions.
Sharing a link using the
sharingaccessor.
Middleware
Add the included Dropbox middleware to any routes that require API access. Requests without a stored token are redirected to the Dropbox authorization page; requests expecting JSON receive a 401 response instead.
Contributing
Please see CONTRIBUTING for details.
Changelog
For changes made to the project, see the Changelog.
License
The MIT License (MIT). See License File for more information.