1. Go to this page and download the library: Download dcblogdev/laravel-box library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
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();
});
Box::get('users/me');
Box::post('folders', [
'name' => 'name of the folder',
'parent' => [
'id' => 0
]
]);