Laravel / Composer

Hi,

I have an issue that some other users have about using the composer require dhtmlx/connector-php command line for my Laravel project.

First it will display during installation such thing :

Warning: Ambiguous class resolution, "Dhtmlx\Connector\DataStorage\PHPCIResultSet" was found in both "/Users/sebastien/Sites/foo/vendor/dhtmlx/connector-php/codebase/Dhtmlx/Connector/DataStorage/PHPCIDBDataWrapper.php" and "/Users/sebastien/Sites/foo/vendor/dhtmlx/connector-php/codebase/Dhtmlx/Connector/DataStorage/PHPCI2DBDataWrapper.php", the first will be used.

The the ‘/gantt_data’ route (using this tutorial https://dhtmlx.com/blog/using-dhtmlxgantt-with-laravel/)

Will generate corrupted xml (with empty id fields):

[code]

<start_date>

</start_date>
<end_date>

</end_date>

[/code]

which in turn will generate an error on the Gantt graph displayed (‘Invalid arguments’ errors).

I found a turn around :

by changing the GanttController lines from

$connector->render_table(new GanttTask(),"id","start_date,end_date,...");

to

$connector->render_table(GanttTask::all(), "id","start_date,end_date,...");

No idea if it’s a good approach (at least it shows data correctly) but I find the actual composer connector very tricky to use.

Hello,
We currently recommend implementing laravel backend by hand, please check this tutorial:
docs.dhtmlx.com/gantt/desktop__ … ravel.html , there should also be a ready demo on github.
The main reason is that in case of laravel they don’t simplify much, and there is generally more info available on laravel than on dhtmlx connectors.

Thanks Aliaksandr, I will have a look at it