PHP code example of donovanbroquin / flysystem-alfresco

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

    

donovanbroquin / flysystem-alfresco example snippets


# app/Providers/AppServiceProvider.php

use Donovanbroquin\FlysystemAlfresco\AlfrescoAdapter;
use Illuminate\Support\Facades\Storage;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Filesystem\FilesystemAdapter;
use League\Flysystem\Filesystem;

public function boot(): void
{
    Storage::extend('alfresco', function (Application $app, array $config) {
        $adapter = new AlfrescoAdapter($config);
 
        return new FilesystemAdapter(
            new Filesystem($adapter, $config),
                $adapter,
                $config
        );
    });
}

# config/filesystems.php

return [
    'disks' => [
        // ...

        'alfresco' => [
            'driver' => 'alfresco',
            'url' => 'https://alfresco.xyz',
            'site' => 'internal',
            'username' => 'username',
            'password' => 'password'
        ]
    ]
]

Storage::disk('alfresco')->put('test.txt', 'Hello world');