I've got a form and when I click submit and It calls the controller but this gives me an error:
Also I tried to create a Folder in my dropbox to check If there are some problem to call the class but It works.
<?php
namespace App\Http\Controllers;
use GrahamCampbell\Dropbox\Facades\Dropbox;
use Illuminate\Http\Request;
use App\Test;
class ArticulosController extends Controller
{
public function store(){
$file = fopen('path/test.pdf', 'rb');
$size = filesize('path/test.pdf');
Dropbox::uploadFile('test.pdf', Dropbox\WriteMode::add(), $file, $size);
Dropbox::createFolder('/example'); //This function works
return redirect ('/home');
}
}
In spite of I tried to call WriteMode class, for some reason the function doesn't call WriteMode correctly. So I finally use Dropbox Adapter and know it works.