PHPackages                             tomshaw/laravel-dropbox - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tomshaw/laravel-dropbox

ActiveLibrary[API Development](/categories/api)

tomshaw/laravel-dropbox
=======================

A Laravel Dropbox API client library.

v1.4.0(1mo ago)419MITPHPPHP ^8.5CI passing

Since Apr 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/tomshaw/laravel-dropbox)[ Packagist](https://packagist.org/packages/tomshaw/laravel-dropbox)[ Docs](https://github.com/tomshaw/laravel-dropbox)[ RSS](/packages/tomshaw-laravel-dropbox/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (16)Versions (24)Used By (0)

Laravel Dropbox 📂
=================

[](#laravel-dropbox-)

A Laravel Dropbox API 2.0 client library.

[![GitHub Workflow Status](https://camo.githubusercontent.com/1c9faad1288e20454a43f9fd715ca3b9161334896a2119ca150b0f362b1f77a2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f6d736861772f6c61726176656c2d64726f70626f782f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265266c6162656c3d7465737473)](https://camo.githubusercontent.com/1c9faad1288e20454a43f9fd715ca3b9161334896a2119ca150b0f362b1f77a2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f6d736861772f6c61726176656c2d64726f70626f782f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265266c6162656c3d7465737473)[![issues](https://camo.githubusercontent.com/5316d9b19b34f31d1b74c7354d00b27f571cb22345a9069c0779cfb3d59c91ac/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f746f6d736861772f6c61726176656c2d64726f70626f783f7374796c653d666c6174266c6f676f3d6170707665796f72)](https://camo.githubusercontent.com/5316d9b19b34f31d1b74c7354d00b27f571cb22345a9069c0779cfb3d59c91ac/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f746f6d736861772f6c61726176656c2d64726f70626f783f7374796c653d666c6174266c6f676f3d6170707665796f72)[![forks](https://camo.githubusercontent.com/428e7a7d978b4f88518216acf1f2142fd9127a1e8cb1f05a7453412e511afda5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f746f6d736861772f6c61726176656c2d64726f70626f783f7374796c653d666c6174266c6f676f3d6170707665796f72)](https://camo.githubusercontent.com/428e7a7d978b4f88518216acf1f2142fd9127a1e8cb1f05a7453412e511afda5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f746f6d736861772f6c61726176656c2d64726f70626f783f7374796c653d666c6174266c6f676f3d6170707665796f72)[![stars](https://camo.githubusercontent.com/376d6bd5a9654caa0670b2f13aacc5a036ddb17013dad1cf49310988ee0b04f8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f746f6d736861772f6c61726176656c2d64726f70626f783f7374796c653d666c6174266c6f676f3d6170707665796f72)](https://camo.githubusercontent.com/376d6bd5a9654caa0670b2f13aacc5a036ddb17013dad1cf49310988ee0b04f8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f746f6d736861772f6c61726176656c2d64726f70626f783f7374796c653d666c6174266c6f676f3d6170707665796f72)[![GitHub license](https://camo.githubusercontent.com/3d782cff25741c02866443e6ff8451ab221fd524c43d54b730fc2a9c5ad597e5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f746f6d736861772f6c61726176656c2d64726f70626f78)](https://github.com/tomshaw/laravel-dropbox/blob/master/LICENSE)

Requirements
------------

[](#requirements)

- PHP ^8.2
- Laravel ^12.0 | ^13.0

Features
--------

[](#features)

- **Customizable Token Storage**: User definable token storage adapters to suit your apps needs providing flexibility in how and where you store your tokens.
- **Token Refresh Middleware**: Automatically handles token refreshing, ensuring your application maintains a valid API connection without manual intervention.
- **Laravel Facades Integration**: Built using Laravel Facades offering a familiar and simple interface that promotes readability, flexibility, testing and ease of use.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tomshaw/laravel-dropbox
```

Next publish the configuration file:

```
php artisan vendor:publish --provider="TomShaw\Dropbox\Providers\DropboxServiceProvider" --tag=config

```

Run the migration if you wish to use database storage adapter:

```
php artisan migrate

```

Configuration
-------------

[](#configuration)

Here's a breakdown of each configuration option:

> The following variables should be set in your `.env` file

- `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`: This is the access token for Dropbox API requests.
- `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.

> Developers should review the [Dropbox Developer Platform](https://www.dropbox.com/developers) and [SDK Documentation](https://www.dropbox.com/developers/documentation) for further information.

Basic Usage
-----------

[](#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 `check` accessor `app` method.

```
namespace App\Http\Controllers;

use TomShaw\Dropbox\Dropbox;
use TomShaw\Dropbox\DropboxClient;

class DropboxController extends Controller
{
    public function check()
    {
        Dropbox::check()->app(['query' => 'foo']);
    }
}
```

> Authorizing the application and persisting the token.

```
namespace App\Http\Controllers;

use TomShaw\Dropbox\Dropbox;

class DropboxController extends Controller
{
    public function connect()
    {
        if (request()->has('code')) {

            Dropbox::connect(request('code'));

            return redirect()->route('dashboard');
        }

        return redirect()->away(Dropbox::getAuthUrl());
    }
}
```

> Revoking access using the `revoke` accessor.

```
namespace App\Http\Controllers;

use TomShaw\Dropbox\Dropbox;

class DropboxController extends Controller
{
    public function revoke()
    {
        Dropbox::revoke();

        return redirect()->route('dashboard');
    }
}
```

> Requesting account information using the `users` accessor.

```
namespace App\Http\Controllers;

use TomShaw\Dropbox\Dropbox;

class DropboxController extends Controller
{
    public function account()
    {
        Dropbox::users()->getCurrentAccount();
    }
}
```

> Creating folders using the `files` accessor.

```
namespace App\Http\Controllers;

use TomShaw\Dropbox\Dropbox;

class DropboxController extends Controller
{
    public function createfolder(string $path)
    {
        Dropbox::files()->createFolder($path, true);
    }
}
```

> Downloading files using the `files` accessor.

```
namespace App\Http\Controllers;

use TomShaw\Dropbox\Dropbox;

class DropboxController extends Controller
{
    public function download($id)
    {
        $item = Dropbox::files()->getMetadata($id);

        if ($item) {
            $fileContents = Dropbox::files()->download($item['path_lower']);

            return response($fileContents, 200, [
                'Content-Type' => 'application/octet-stream',
                'Content-Disposition' => 'attachment; filename="' . $item['name'] . '"',
            ]);
        }

        return abort(404);
    }
}
```

> Uploading files using the `files` accessor.

```
namespace App\Http\Controllers;

use TomShaw\Dropbox\Dropbox;

class DropboxController extends Controller
{
    public function upload(string $path)
    {
        Dropbox::files($client)->upload($destinationPath, $sourceFilePath, mode: 'add', autorename: false, mute: false, strictConflict: false);
    }
}
```

> Sharing a link using the `sharing` accessor.

```
namespace App\Http\Controllers;

use TomShaw\Dropbox\Dropbox;
use TomShaw\Dropbox\DropboxClient;

class DropboxController extends Controller
{
    public function sharelink(string $path)
    {
        Dropbox::sharing()->createSharedLinkWithSettings($path, ['requested_visibility' => 'public']);
    }
}
```

Middleware
----------

[](#middleware)

Add the included Dropbox `middleware` to any routes that require API access.

```
Route::group(['middleware' => ['web', 'auth', 'dropbox']], function () {
  /* Grouped routes */
});
```

Requirements
------------

[](#requirements-1)

The package is compatible with PHP 8 or later.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Changelog
---------

[](#changelog)

For changes made to the project, see the [Changelog](CHANGELOG.md).

License
-------

[](#license)

The MIT License (MIT). See [License File](LICENSE) for more information.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance92

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~106 days

Total

21

Last Release

38d ago

Major Versions

v0.2.3 → v1.0.02024-04-18

v0.2.4 → v1.1.12025-02-02

PHP version history (5 changes)v0.1.0PHP ^8.1|^8.2

v1.1.1PHP ^8.1|^8.2|^8.3|^8.4

v1.1.2PHP ^8.2|^8.3|^8.4

v1.2.0PHP ^8.2|^8.3|^8.4|^8.5

v1.3.0PHP ^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/14fd02efdbaf6247b61c9846697c86dabcbf430374aeff0d80e509d95d186658?d=identicon)[Tom Shaw](/maintainers/Tom%20Shaw)

---

Top Contributors

[![tomshaw](https://avatars.githubusercontent.com/u/32818?v=4)](https://github.com/tomshaw "tomshaw (64 commits)")

---

Tags

laraveldropbox

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tomshaw-laravel-dropbox/health.svg)

```
[![Health](https://phpackages.com/badges/tomshaw-laravel-dropbox/health.svg)](https://phpackages.com/packages/tomshaw-laravel-dropbox)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[nickurt/laravel-postcodeapi

Universal PostcodeApi for Laravel 11.x/12.x/13.x

97221.2k](/packages/nickurt-laravel-postcodeapi)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
