Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

hirohamada's avatar

How to Integrate Alfresco in Laravel?

Anyone help me please......How to integrate Rest API Alfresco (Login, Upload, Download, etc) with Laravel?? Thanks

0 likes
8 replies
devfrey's avatar

I think this question is way too broad. If you have any more specific questions, feel free to ask them.

hirohamada's avatar

Maybe I need all document about integrate/syncronize Alfresco with Laravel, because I don't know what should I do. and I try "composer require ajtarragona/alfresco-laravel", but many error.

devfrey's avatar

@HIROHAMADA - If you post the errors here, maybe someone can help. Otherwise there's not enough information to assist.

hirohamada's avatar
Ajtarragona \ AlfrescoLaravel \ Exceptions \ AlfrescoObjectNotFoundException
Object not found in Alfresco
 return $ret;
        } catch (RequestException | ConnectException | ClientException $e) {
            //dd($e->getMessage());
            
            if ($e->hasResponse()) {
                //dd($e->getResponse());
               $status=$e->getResponse()->getStatusCode();
 
               switch($status){
                       case 404:
                        throw new AlfrescoObjectNotFoundException(__("Object not found in Alfresco")); break;
                    case 401:
                        //Authentication exception
                        throw new AlfrescoAuthenticationException(__("User authentication exception")); break;
                    case 403:
                        //Permissions exception
                        throw new AlfrescoNotAllowedException(__("User doesn't have permission")); break;
                    case 409: 
                        //New name clashes with an existing node in the current parent folder
                        throw new AlfrescoObjectAlreadyExistsException(__("Name already exists")); break;
                    case 413: 
                    case 507: 
                        //size limit
                        throw new AlfrescoSizeLimitException(__("Size limit exceeded")); break;
                    case 422: 
                        //name containing invalid characters
devfrey's avatar

@HIROHAMADA - Looks like an integration problem. Where's the code that's trying to interface with the Alfresco package?

hirohamada's avatar

This is the Controller

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Alfresco;
use Ajtarragona\AlfrescoLaravel\Exceptions\AlfrescoConnectionException;
use Ajtarragona\AlfrescoLaravel\Exceptions\AlfrescoObjectAlreadyExistsException;
use Ajtarragona\AlfrescoLaravel\Models\Helpers\AlfrescoHelper;
use Ajtarragona\AlfrescoLaravel\Models\AlfrescoDocument;
use Ajtarragona\AlfrescoLaravel\Models\Vendor\Cmis\CMISService;

lass AlfrescoController extends Controller
{
   
    public function list($id) {

      Alfresco::list($id);
    }

}
Nick_forbizz's avatar

@hirohamada

Installation

composer require ajtarragona/alfresco-laravel:"@dev"

Configuration in config/app.php set the provider and its alias

Ajtarragona\AlfrescoLaravel\AlfrescoLaravelServiceProvider::class,

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

...then publish alfresso configuration for connection with your data

php artisan vendor:publish --tag=alfresco

you will find it in config/alfresso.php

Please or to participate in this conversation.