A Laravel package for working with Box.

Box API documentation can be found at:

Import Namespace

use Dcblogdev\Box\Facades\Box;

A routes example:

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

    //if no box token exists then redirect
    //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


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);

© 2006 - 2023 DC Blog. All code MIT license. All rights reserved.