PHPackages                             daveismynamelaravel/box - 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. [Framework](/categories/framework)
4. /
5. daveismynamelaravel/box

Abandoned → [https://github.com/dcblogdev/laravel-box](/?search=https%3A%2F%2Fgithub.com%2Fdcblogdev%2Flaravel-box)Library[Framework](/categories/framework)

daveismynamelaravel/box
=======================

A Laravel Box package

v2.1.9(1mo ago)9268[1 issues](https://github.com/dcblogdev/laravel-box/issues)MITPHPPHP ^8.1CI failing

Since Aug 18Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/dcblogdev/laravel-box)[ Packagist](https://packagist.org/packages/daveismynamelaravel/box)[ Docs](https://github.com/dcblogdev/laravel-box)[ GitHub Sponsors](https://github.com/dcblogdev)[ RSS](/packages/daveismynamelaravel-box/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (10)Versions (34)Used By (0)

Community
---------

[](#community)

There is a Discord community.  For quick help, ask questions in the appropriate channel.

[![Latest Version on Packagist](https://camo.githubusercontent.com/db39b51f7add2320f59e73c64f46f1577b81e1515c9d938f365e807d8554621b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6463626c6f676465762f6c61726176656c2d626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dcblogdev/laravel-box)[![Total Downloads](https://camo.githubusercontent.com/772866d3ef5d0085ca35ef32237579b175740510af434b1729fe64307b786c94/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6463626c6f676465762f6c61726176656c2d626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dcblogdev/laravel-box)

[![Logo](https://repository-images.githubusercontent.com/145237952/11826600-494d-11eb-88fa-264ef0affd6b)](https://repository-images.githubusercontent.com/145237952/11826600-494d-11eb-88fa-264ef0affd6b)

A Laravel package for working with box API.

Box API documentation can be found at:

Application Register
====================

[](#application-register)

To use Box API an application needs creating at

Select the type of application. Select custom if you need to access the API abilities.

Select the Oauth2 app type after selecting custom.

Install
=======

[](#install)

Via Composer
------------

[](#via-composer)

```
composer require dcblogdev/laravel-box

```

Config
------

[](#config)

You can publish the config file with:

```
php artisan vendor:publish --provider="Dcblogdev\Box\BoxServiceProvider" --tag="config"

```

When published, the config/box.php config file contains:

```
return [
    'clientId'       => env('BOX_CLIENT_ID'),
    'clientSecret'   => env('BOX_SECRET_ID'),
    'redirectUri'    => env('BOX_REDIRECT_URI'),
    'boxLandingUri'  => env('BOX_LANDING_URI'),
    'urlAuthorize'   => 'https://account.box.com/api/oauth2/authorize',
    'urlAccessToken' => 'https://www.box.com/api/oauth2/token',
];
```

Migration
---------

[](#migration)

You can publish the migration with:

```
php artisan vendor:publish --provider="Dcblogdev\Box\BoxServiceProvider" --tag="migrations"

```

After the migration has been published you can create the tokens tables by running the migration:

```
php artisan migrate

```

.ENV Configuration
------------------

[](#env-configuration)

You should add the env variables to your .env file, this allows you to use a different box application on different servers, each box application requires a unique callback URL.

The following are required when using OAuth 2.0 credentials:

The `BOX_REDIRECT_URI` is where Box should redirect to for authentication with Box, upon successful authentication the `BOX_LANDING_URI` is used to direct a user to the desired page. &gt; Note BOX\_REDIRECT\_URI needs to be the full URI ie

```
BOX_CLIENT_ID=
BOX_SECRET_ID=
BOX_REDIRECT_URI=https://domain.com/box/oauth
BOX_LANDING_URI=https://domain.com/box

```

Usage
-----

[](#usage)

Import Namespace

```
use Dcblogdev\Box\Facades\Box;
```

A routes example:

```
Route::get('box', function() {

    //if no box token exists then redirect
    Box::getAccessToken();

    //box authenticated now box:: can be used freely.

    //example of getting the authenticated users details
    return Box::get('/users/me');

});

Route::get('box/oauth', function() {
    return Box::connect();
});
```

Calls can be made by referencing Box:: then the verb get,post,put,patch or delete followed by the end point to call. An array can be passed as a second option.

The end points are relative paths after

Example GET request

```
Box::get('users/me');
```

Example POST request

```
Box::post('folders', [
    'name' => 'name of the folder',
    'parent' => [
        'id' => 0
    ]
]);
```

The formula is:

```
Box::get('path', $array);
Box::post('path', $array);
Box::put('path', $array);
Box::patch('path', $array);
Box::delete('path', $array);
```

Working with Files
------------------

[](#working-with-files)

This package provides a clean way of working with files.

To work with files first call -&gt;files() followed by a method.

Get file Accepts a file id, returns an array.

```
Box::files()->file($id);
```

Download file Accepts a file id Optionally a path can be used when $storeDownload is set to true. To download the file only an id is required.

```
Box::files()->download($id, $path = '', $storeDownload = false);
```

Upload file Accepts a file path and filename. Optionally specificy the parent, defaults to 0 when ommited.

```
Box::files()->upload($path, $name, $parent = 0);
```

Upload revision Accepts the file id, file path and filename. Optionally specificy a new name.

```
Box::files()->uploadRevision($file_id, $filepath, $name, $newname = null);
```

Delete file Accepts a file id, returns no output.

```
Box::files()->destroy($id);
```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

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

[](#contributing)

Contributions are welcome and will be fully credited.

Contributions are accepted via Pull Requests on [Github](https://github.com/dcblogdev/laravel-box).

Pull Requests
-------------

[](#pull-requests)

- **Document any change in behaviour** - Make sure the `readme.md` and any other relevant documentation are kept up-to-date.
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

Security
--------

[](#security)

If you discover any security related issues, please email  email instead of using the issue tracker.

License
-------

[](#license)

license. Please see the [license file](license.md) for more information.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance87

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 54.4% 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 ~106 days

Recently: every ~327 days

Total

27

Last Release

55d ago

Major Versions

0.0.10 → v1.0.02018-08-21

v1.0.0 → v2.0.02020-02-23

PHP version history (3 changes)v2.0.2PHP ^7.2

v2.1.3PHP ^7.2|^8.0

v2.1.7PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39399156?v=4)[dcblog](/maintainers/dcblog)[@dcblog](https://github.com/dcblog)

---

Top Contributors

[![dcblogdev](https://avatars.githubusercontent.com/u/1018170?v=4)](https://github.com/dcblogdev "dcblogdev (31 commits)")[![daveismynamecom](https://avatars.githubusercontent.com/u/60222583?v=4)](https://github.com/daveismynamecom "daveismynamecom (24 commits)")[![dslavikwlt](https://avatars.githubusercontent.com/u/48707471?v=4)](https://github.com/dslavikwlt "dslavikwlt (1 commits)")[![lukeskelding](https://avatars.githubusercontent.com/u/11160855?v=4)](https://github.com/lukeskelding "lukeskelding (1 commits)")

---

Tags

boxhacktoberfestlaravel-packagelaravelbox

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/daveismynamelaravel-box/health.svg)

```
[![Health](https://phpackages.com/badges/daveismynamelaravel-box/health.svg)](https://phpackages.com/packages/daveismynamelaravel-box)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.4k10.6M274](/packages/laravel-boost)[laravel/slack-notification-channel

Slack Notification Channel for laravel.

89069.7M111](/packages/laravel-slack-notification-channel)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M225](/packages/laravel-horizon)[laravel/envoy

Elegant SSH tasks for PHP.

1.6k5.5M18](/packages/laravel-envoy)

PHPackages © 2026

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