{"id":15690625,"url":"https://github.com/dcblogdev/laravel-box","last_synced_at":"2025-05-07T23:08:52.609Z","repository":{"id":36974952,"uuid":"145237952","full_name":"dcblogdev/laravel-box","owner":"dcblogdev","description":"Laravel package for BOX API","archived":false,"fork":false,"pushed_at":"2025-02-24T22:56:52.000Z","size":294,"stargazers_count":8,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T23:08:44.944Z","etag":null,"topics":["box","hacktoberfest","laravel-package"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcblogdev.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/FUNDING.yml","license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["dcblogdev"]}},"created_at":"2018-08-18T17:06:01.000Z","updated_at":"2025-02-24T22:55:21.000Z","dependencies_parsed_at":"2023-02-18T04:55:19.248Z","dependency_job_id":"0ddb6d76-78d2-484b-93a9-22e10077605d","html_url":"https://github.com/dcblogdev/laravel-box","commit_stats":{"total_commits":43,"total_committers":4,"mean_commits":10.75,"dds":0.4651162790697675,"last_synced_commit":"8de77ce0d4d72f013c7dc57abf9958b488c48663"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcblogdev%2Flaravel-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcblogdev%2Flaravel-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcblogdev%2Flaravel-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcblogdev%2Flaravel-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcblogdev","download_url":"https://codeload.github.com/dcblogdev/laravel-box/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968118,"owners_count":21833252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["box","hacktoberfest","laravel-package"],"created_at":"2024-10-03T18:13:01.729Z","updated_at":"2025-05-07T23:08:52.588Z","avatar_url":"https://github.com/dcblogdev.png","language":"PHP","funding_links":["https://github.com/sponsors/dcblogdev"],"categories":[],"sub_categories":[],"readme":"## Community\n\nThere is a Discord community. https://discord.gg/VYau8hgwrm For quick help, ask questions in the appropriate channel.\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/dcblogdev/laravel-box.svg?style=flat-square)](https://packagist.org/packages/dcblogdev/laravel-box)\n[![Total Downloads](https://img.shields.io/packagist/dt/dcblogdev/laravel-box.svg?style=flat-square)](https://packagist.org/packages/dcblogdev/laravel-box)\n\n![Logo](https://repository-images.githubusercontent.com/145237952/11826600-494d-11eb-88fa-264ef0affd6b)\n\nA Laravel package for working with box API.\n\nBox API documentation can be found at:\nhttps://developer.box.com/\n\n# Application Register\n\nTo use Box API an application needs creating at https://app.box.com/developers/console/newapp\n\nSelect the type of application. Select custom if you need to access the API abilities.\n\nSelect the Oauth2 app type after selecting custom.\n\n# Install\n\n## Via Composer\n\n```\ncomposer require dcblogdev/laravel-box\n```\n\n## Config\n\nYou can publish the config file with:\n\n```\nphp artisan vendor:publish --provider=\"Dcblogdev\\Box\\BoxServiceProvider\" --tag=\"config\"\n```\n\nWhen published, the config/box.php config file contains:\n\n```php\nreturn [\n    'clientId'       =\u003e env('BOX_CLIENT_ID'),\n    'clientSecret'   =\u003e env('BOX_SECRET_ID'),\n    'redirectUri'    =\u003e env('BOX_REDIRECT_URI'),\n    'boxLandingUri'  =\u003e env('BOX_LANDING_URI'),\n    'urlAuthorize'   =\u003e 'https://account.box.com/api/oauth2/authorize',\n    'urlAccessToken' =\u003e 'https://www.box.com/api/oauth2/token',\n];\n```\n\n## Migration\n\nYou can publish the migration with:\n\n```\nphp artisan vendor:publish --provider=\"Dcblogdev\\Box\\BoxServiceProvider\" --tag=\"migrations\"\n```\n\nAfter the migration has been published you can create the tokens tables by running the migration:\n\n```\nphp artisan migrate\n```\n\n## .ENV Configuration\n\nYou 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.\n\nThe following are required when using OAuth 2.0 credentials:\n\nThe `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. \u003e Note BOX_REDIRECT_URI needs to be the full URI ie https://domain.com/box/\n\n\n```\nBOX_CLIENT_ID=\nBOX_SECRET_ID=\nBOX_REDIRECT_URI=https://domain.com/box/oauth\nBOX_LANDING_URI=https://domain.com/box\n```\n\n## Usage\n\n\nImport Namespace\n\n```php\nuse Dcblogdev\\Box\\Facades\\Box;\n```\n\nA routes example:\n\n```php\nRoute::get('box', function() {\n\n    //if no box token exists then redirect\n    Box::getAccessToken(); \n    \n    //box authenticated now box:: can be used freely.\n\n    //example of getting the authenticated users details\n    return Box::get('/users/me');\n    \n});\n\nRoute::get('box/oauth', function() {\n    return Box::connect();\n});\n```\n\nCalls 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.\n\nThe end points are relative paths after https://api.box.com/2.0/\n\nExample GET request\n\n```php\nBox::get('users/me');\n```\n\nExample POST request\n\n```php\nBox::post('folders', [\n    'name' =\u003e 'name of the folder',\n    'parent' =\u003e [\n        'id' =\u003e 0\n    ]\n]);\n```\n\nThe formula is:\n\n```php\nBox::get('path', $array);\nBox::post('path', $array);\nBox::put('path', $array);\nBox::patch('path', $array);\nBox::delete('path', $array);\n```\n## Working with Files\n\nThis package provides a clean way of working with files.\n\nTo work with files first call -\u003efiles() followed by a method.\n\nGet file\nAccepts a file id, returns an array.\n\n```php\nBox::files()-\u003efile($id);\n```\n\nDownload file\nAccepts a file id Optionally a path can be used when $storeDownload is set to true. To download the file only an id is required.\n\n```php\nBox::files()-\u003edownload($id, $path = '', $storeDownload = false);\n```\n\nUpload file\nAccepts a file path and filename. Optionally specificy the parent, defaults to 0 when ommited.\n\n```php\nBox::files()-\u003eupload($path, $name, $parent = 0);\n```\n\nUpload revision\nAccepts the file id, file path and filename. Optionally specificy a new name.\n\n```php\nBox::files()-\u003euploadRevision($file_id, $filepath, $name, $newname = null);\n```\n\nDelete file\nAccepts a file id, returns no output.\n\n```php\nBox::files()-\u003edestroy($id);\n```\n\n## Change log\n\nPlease see the [changelog][3] for more information on what has changed recently.\n\n## Contributing\n\nContributions are welcome and will be fully credited.\n\nContributions are accepted via Pull Requests on [Github][4].\n\n## Pull Requests\n\n- **Document any change in behaviour** - Make sure the `readme.md` and any other relevant documentation are kept up-to-date.\n\n- **Consider our release cycle** - We try to follow [SemVer v2.0.0][5]. Randomly breaking public APIs is not an option.\n\n- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.\n\n## Security\n\nIf you discover any security related issues, please email dave@dcblog.dev email instead of using the issue tracker.\n\n## License\n\nlicense. Please see the [license file][6] for more information.\n\n[3]:    changelog.md\n[4]:    https://github.com/dcblogdev/laravel-box\n[5]:    http://semver.org/\n[6]:    license.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcblogdev%2Flaravel-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcblogdev%2Flaravel-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcblogdev%2Flaravel-box/lists"}