PHP code example of ajtarragona / alfresco-laravel

1. Go to this page and download the library: Download ajtarragona/alfresco-laravel 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/ */

    

ajtarragona / alfresco-laravel example snippets


use Alfresco;
...
public  function  test(){
    $file=Alfresco::getDocument("xxx-yyy-zzz");
    ...
}

'aliases'  =>  [
    ...
    'Alfresco'  =>  Ajtarragona\AlfrescoLaravel\Facades\Alfresco::class
]

use Ajtarragona\AlfrescoLaravel\Models\AlfrescoService;
...

public  function  test(AlfrescoService  $client){
    $file=$client->getDocument("xxx-yyy-zzz");
    ...
}

...
public  function  test(){
    $file=alfresco()->getDocument("xxx-yyy-zzz");
    ...
}

'disks' =>[
    ...

    'alfresco_fs' => [
        'driver' => 'alfresco',
        'url' => env('ALFRESCO_URL', 'https://alfresco/alfresco'),
        'api' => env('ALFRESCO_API', 'rest'),
        'api_version' => env('ALFRESCO_API_VERSION', '1'),
        'repository_id' => env('ALFRESCO_REPOSITORY_ID', '-default-'),
        'user' => env('ALFRESCO_USER', ''),
        'pass' => env('ALFRESCO_PASSWORD', ''),
        'base_id' => env('ALFRESCO_BASE_ID', ''),
        'base_path' => rtrim(env('ALFRESCO_BASE_PATH', '/'), '/'),
        'repeated_policy' => env('ALFRESCO_REPEATED_POLICY', 'rename'),
        'verify_ssl' => env('ALFRESCO_VERIFY_SSL', false),
        'debug' => env('ALFRESCO_DEBUG', false),
    ],
    ...
]

Storage::disk('alfresco_fs')->files('directori');
Storage::disk('alfresco_fs')->download('file.jpg');
...


bash
php artisan vendor:publish --tag=ajtarragona-alfresco