Add service provider and facade:
DocumentStore\DocumentStoreServiceProvider::class
'DocumentStore' => DocumentStore\DocumentStoreFacade::class
Run:
php artisan vendor:publish
Create Meta model:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Meta extends Model {
protected $table = 'docstore_meta';
public $timestamps = false;
}
Edit config:
<?php
return [
// Dropbox access token
'access_token' => 'testkey',
// Meta table
'meta_table' => 'docstore_meta',
// Meta table primary key
'meta_table_id' => 'id',
// Meta model class
'meta_model' => '\App\Meta'
];
Run migration:
php artisan migrate
$result = DocumentStore::create('/path/file.txt', '/file1.txt', $meta);
$result = DocumentStore::update('/path/file.txt', '/file2.txt', $meta);
$content = DocumentStore::download('/path/file.txt');
list($content, $mime) = DocumentStore::download('/path/file.txt', 'revision');
$revisions = DocumentStore::revisions('/path/file.txt');
$revisions = DocumentStore::revisions('/path/file.txt', ['meta.xxx']);
$result = DocumentStore::restore('/path/file.txt', 'revision');
$result = DocumentStore::delete('/path/file.txt', $meta);
$link = DocumentStore::createSharedLink('/path/file.txt');