PHP code example of sonergia / alfresco-laravel

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

    

sonergia / alfresco-laravel example snippets


Sonergia\AlfrescoLaravel\AlfrescoLaravelServiceProvider::class,

'Alfresco' => Sonergia\AlfrescoLaravel\Models\AlfrescoLaravel::class

use Alfresco; // At the top of your controller
------
Alfresco::upload($file); //When you want to upload a file, being $file a UploadedFile instance

use Alfresco; // At the top of your controller
------
Alfresco::list($nodeId); //When you want to list the content of a folder, being $nodeId the id of the folder to list

[
	"back" => "b4cff62a-664d-4d45-9302-98723eac1319", //The id of the parent folder (optional)
	"children" => [ //Array with all the childs of the folder (optional)
					[
						"id":"b31cfcd4-06a8-4a8e-8073-2b047aa2f82a", //The id of the child
						"name":"image1.png", //The name of the document/folder
						"isFolder":false //Boolean to indicate if the node is a folder or not
					],
					[
						"id":"a6b424ec-48b5-47b0-b42a-73785ed3d487",
						"name":"image2.jpg",
						"isFolder":false
					],
					[
						"id":"f2cb8696-a9a3-49d8-bd16-5960cb0c2948",
						"name":"document.pdf",
						"isFolder":false
					],
					[
						"id":"f1ba047c-d9b1-4554-aa56-7004f7327cf5",
						"name":"test",
						"isFolder":true
					]
				]
]

use Alfresco; // At the top of your controller
------
Alfresco::download($nodeId, $destinationFolder); //When you want to download a file, being $nodeId the id of the node to download and $destinationFolder the route to the folder where de node will be storaged
bash
php artisan vendor:publish --tag=alfresco