{"id":3187,"date":"2016-01-21T11:00:42","date_gmt":"2016-01-21T07:00:42","guid":{"rendered":"http:\/\/www.dhtmlx.com\/blog\/?p=3187"},"modified":"2023-05-05T13:27:26","modified_gmt":"2023-05-05T10:27:26","slug":"using-dhtmlxgantt-with-laravel","status":"publish","type":"post","link":"https:\/\/dhtmlx.com\/blog\/using-dhtmlxgantt-with-laravel\/","title":{"rendered":"Using dhtmlxGantt with Laravel Framework [Tutorial]"},"content":{"rendered":"<p>Our developers always try to provide you with the possibility to use our components in different ways. In this article, we&#8217;ll talk about <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxGantt\/\" target=\"_blank\">dhtmlxGantt<\/a>. We&#8217;ll learn how to use this component with the <a href=\"https:\/\/laravel.com\/\" target=\"_blank\">Laravel<\/a> framework. Laravel is a free, open-source PHP web application framework. Laravel was created for the development of web applications following the model\u2013view\u2013controller (MVC) architectural pattern.<\/p>\n<p><strong><a href=\"\/\/dhtmlx.com\/docs\/products\/dhtmlxGantt\/download.shtml\" onclick=\"ga('send', 'event', 'link', 'click', 'download-gantt-laravel-link')\">Download dhtmlxGantt and start using it with Laravel<\/a><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2016\/01\/laravelgantt-img.png\" alt=\"laravel+gantt-img\" width=\"600\" height=\"311\" class=\"aligncenter size-full wp-image-3190\" srcset=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2016\/01\/laravelgantt-img.png 600w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2016\/01\/laravelgantt-img-300x156.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>It will be a step-by-step guide intended both for developers who have already been familiar with Laravel and those of you who only starts working with it.<br \/>\n<!--more--><\/p>\n<h2><b>Installing Laravel<\/b><\/h2>\n<p>\nWe&#8217;ll use <a href=\"https:\/\/getcomposer.org\/\" target=\"_blank\">Composer<\/a> to install Laravel. It&#8217;s a dependency manager for PHP that allows you add required packages to your projects in a fast and easy way. Usually, you can find it in your Linux repository. In another case, you can download installation files from its home page.<\/p>\n<p>To learn how you can install Laravel, you can follow this <a href=\"https:\/\/laravel.com\/docs\/5.1\/installation\" target=\"_blank\">installation guide<\/a>. Here&#8217;s one of the available opportunities. First of all, we need to create a folder for our project and download the Laravel packages. Run in your terminal:<\/p>\n<div class=\"codecolorer-container text default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">composer create-project &nbsp;laravel\/laravel --prefer-dist dhtmlxGantt<\/div><\/div>\n<p>This code will create the <em>dhtmlxGantt<\/em> folder and load the Laravel files along with its dependencies into it.<\/p>\n<p>Now we need to add <a href=\"https:\/\/docs.dhtmlx.com\/connector__php__index.html\" target=\"_blank\">dhtmlxConnector<\/a> to our project. It&#8217;s a helper server-side library that enables access to external data sources and backend systems. To do so, enter the working directory and add the required package using Composer:<\/p>\n<div class=\"codecolorer-container text default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">cd dhtmlxGantt<br \/>\ncomposer require dhtmlx\/connector-php<\/div><\/div>\n<p>One more thing before getting started. Download the <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxGantt\/download.shtml\" target=\"_blank\">dhtmlxGantt package<\/a> and unpack its content within the <em>public\/dhtmlxGantt<\/em> directory.<\/p>\n<p>That&#8217;s it. Preparations are finished, and we can continue creating the Gantt chart.<\/p>\n<h2><b>Create a Data Source<\/b><\/h2>\n<p>\nAs an example, let&#8217;s use a previously created database. Here&#8217;s the <a href=\"https:\/\/dhtmlx.com\/x\/download\/regular\/dhtmlxConnector\/laravel_dhtmlx.zip\" target=\"_blank\">direct link<\/a> to a zip archive that contains the project that you can use as an example of how different DHTMLX components can work with Laravel. Inside you can find an SQL dump file named <em>dhtmlx_samples.sql<\/em>. Let&#8217;s use it to create a local database copy. In case of MySQL you should run the client:<\/p>\n<div class=\"codecolorer-container sql default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"sql codecolorer\">mysql <span class=\"sy0\">-<\/span>u root <span class=\"sy0\">-<\/span>p<\/div><\/div>\n<p>Now you can create a new database and import the data from the dump file:<\/p>\n<div class=\"codecolorer-container text default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">CREATE DATABASE gantt;<br \/>\nUSE gantt;<br \/>\n&nbsp;\\. \/path\/to\/file\/dhtmlx_samples.sql<\/div><\/div>\n<p>Done. The database is created. Our next step is to create a the Gantt chart itself.<\/p>\n<h2><b>Create the Gantt Chart<\/b><\/h2>\n<p>\nAs it was said before, Laravel follows the MVC architectural pattern. Since MVC means Model-View-Controller, the process of creation will consist of three main stages.<\/p>\n<h3><b>Create a Model<\/b><\/h3>\n<p><\/p>\n<p>To access the data we need to specify the appropriate model class. You should create two files within the app directory of your project.<\/p>\n<p>The first one is <em>GanttTask.php<\/em>:<\/p>\n<div class=\"codecolorer-container php default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">&lt;?php<\/span><br \/>\n<span class=\"kw2\">namespace<\/span> App<span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw2\">use<\/span> Illuminate\\Database\\Eloquent\\Model<span class=\"sy0\">;<\/span><br \/>\n<br \/>\n<span class=\"kw2\">class<\/span> GanttTask <span class=\"kw2\">extends<\/span> Model<br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">protected<\/span> <span class=\"re0\">$table<\/span> <span class=\"sy0\">=<\/span> <span class=\"st0\">&quot;gantt_tasks&quot;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"re0\">$primaryKey<\/span> <span class=\"sy0\">=<\/span> <span class=\"st0\">&quot;id&quot;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"re0\">$timestamps<\/span> <span class=\"sy0\">=<\/span> <span class=\"kw4\">false<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>And here&#8217;s the second one, <em>GanttLink.php<\/em>:<\/p>\n<div class=\"codecolorer-container php default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">&lt;?php<\/span><br \/>\n<span class=\"kw2\">namespace<\/span> App<span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw2\">use<\/span> Illuminate\\Database\\Eloquent\\Model<span class=\"sy0\">;<\/span><br \/>\n<br \/>\n<span class=\"kw2\">class<\/span> GanttLink <span class=\"kw2\">extends<\/span> Model<br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">protected<\/span> <span class=\"re0\">$table<\/span> <span class=\"sy0\">=<\/span> <span class=\"st0\">&quot;gantt_links&quot;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"re0\">$primaryKey<\/span> <span class=\"sy0\">=<\/span> <span class=\"st0\">&quot;id&quot;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"re0\">$timestamps<\/span> <span class=\"sy0\">=<\/span> <span class=\"kw4\">false<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<h3><b>Create the View Object<\/b><\/h3>\n<p><\/p>\n<p>Create a new file with name <em>gantt.php<\/em> within the <em>resources\/views<\/em> directory of your project. Then and add the following code:<\/p>\n<div class=\"codecolorer-container html4strict default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"html4strict codecolorer\"><span class=\"sc0\">&lt;!DOCTYPE html&gt;<\/span><br \/>\n<span class=\"sc2\">&lt;<span class=\"kw2\">head<\/span>&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc2\">&lt;<span class=\"kw2\">meta<\/span> <span class=\"kw3\">http-equiv<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;Content-type&quot;<\/span> <span class=\"kw3\">content<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;text\/html; charset=utf-8&quot;<\/span>&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc2\">&lt;<span class=\"kw2\">script<\/span> <span class=\"kw3\">src<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;dhtmlxGantt\/codebase\/dhtmlxgantt.js&quot;<\/span>&gt;&lt;<span class=\"sy0\">\/<\/span><span class=\"kw2\">script<\/span>&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc2\">&lt;<span class=\"kw2\">link<\/span> <span class=\"kw3\">rel<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;stylesheet&quot;<\/span> <span class=\"kw3\">href<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;dhtmlxGantt\/codebase\/dhtmlxgantt.css&quot;<\/span>&gt;<\/span><br \/>\n<span class=\"sc2\">&lt;<span class=\"sy0\">\/<\/span><span class=\"kw2\">head<\/span>&gt;<\/span><br \/>\n<br \/>\n<span class=\"sc2\">&lt;<span class=\"kw2\">body<\/span>&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc2\">&lt;<span class=\"kw2\">div<\/span> <span class=\"kw3\">id<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;gantt_here&quot;<\/span> <span class=\"kw3\">style<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">'width:100%; height:250px;'<\/span>&gt;&lt;<span class=\"sy0\">\/<\/span><span class=\"kw2\">div<\/span>&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc2\">&lt;<span class=\"kw2\">script<\/span> <span class=\"kw3\">type<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;text\/javascript&quot;<\/span>&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; \/* chart configuration and initialization *\/<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; gantt.config.xml_date = &quot;%Y-%m-%d %H:%i:%s&quot;;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; gantt.config.step = 1;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; gantt.config.scale_unit= &quot;day&quot;;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; gantt.init(&quot;gantt_here&quot;, new Date(2010,7,1), new Date(2010,8,1));<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; \/* refers to the 'data' action that we will create in the next substep *\/<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; gantt.load(&quot;.\/gantt_data&quot;, &quot;xml&quot;);<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; \/* refers to the 'data' action as well *\/<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; var dp = new gantt.dataProcessor(&quot;.\/gantt_data&quot;);<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; dp.init(gantt);<br \/>\n&nbsp; &nbsp; <span class=\"sc2\">&lt;<span class=\"sy0\">\/<\/span><span class=\"kw2\">script<\/span>&gt;<\/span><br \/>\n<span class=\"sc2\">&lt;<span class=\"sy0\">\/<\/span><span class=\"kw2\">body<\/span>&gt;<\/span><\/div><\/div>\n<h3><b>Create the Controller<\/b><\/h3>\n<p><\/p>\n<p>Now, let&#8217;s configure the Controller object. Before we go any further, let&#8217;s take a look at how GanttConnector works. Here&#8217;s an example:<\/p>\n<div class=\"codecolorer-container php default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"re0\">$connector<\/span> <span class=\"sy0\">=<\/span> <span class=\"kw2\">new<\/span> GanttConnector<span class=\"br0\">&#40;<\/span><span class=\"kw4\">null<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;PHPLaravel&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"re0\">$connector<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">render_links<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw2\">new<\/span> <span class=\"re0\">$modelName<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$id<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$links<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"re0\">$connector<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">render_table<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw2\">new<\/span> <span class=\"re0\">$modelName<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$id<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$tasks<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>The <strong>GanttConnector<\/strong> constructor takes 2 parameters: <strong>null<\/strong> means that we want to use a model, not a database; <strong>PHPLaravel<\/strong> &#8211; the module for working with PHP.<\/p>\n<p>The <strong>render_links<\/strong> method configures connector, retrieves data from a table with links and takes three parameters: the method creating a model for links, the name of the link id, and a comma-separated list of rendered links.<\/p>\n<p>The <strong>render_table<\/strong> method configures connector and retrieves data from a table with tasks. It takes three parameters as well: the method creating a model for tasks, the name of the task id, and a comma separated list of rendered tasks.<\/p>\n<p>To configure the Controller object you should create a new file named <em>GanttController.php<\/em> within the <em>app\/Http\/Controllers<\/em> folder:<\/p>\n<div class=\"codecolorer-container php default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">&lt;?php<\/span><br \/>\n<span class=\"kw2\">namespace<\/span> App\\Http\\Controllers<span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw2\">use<\/span> App\\GanttTask<span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw2\">use<\/span> App\\GanttLink<span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw2\">use<\/span> Dhtmlx\\Connector\\GanttConnector<span class=\"sy0\">;<\/span><br \/>\n<br \/>\n<span class=\"kw2\">class<\/span> GanttController <span class=\"kw2\">extends<\/span> Controller<br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> data<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$connector<\/span> <span class=\"sy0\">=<\/span> <span class=\"kw2\">new<\/span> GanttConnector<span class=\"br0\">&#40;<\/span><span class=\"kw4\">null<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;PHPLaravel&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$connector<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">render_links<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw2\">new<\/span> GanttLink<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;id&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;source,target,type&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$connector<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">render_table<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw2\">new<\/span> GanttTask<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span><span class=\"st0\">&quot;id&quot;<\/span><span class=\"sy0\">,<\/span><span class=\"st0\">&quot;start_date,duration,text,progress,parent&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<h2><b>Final Steps: Environment, Routes, and CSRF Protection<\/b><\/h2>\n<p>There are three final steps left before you can test your application. Let&#8217;s start from the environment configuration. The <em>.env<\/em> file that resides in the root folder of your project will be used for that purpose. All that we need is to configure the database. Here are the four lines that we are interested in:<\/p>\n<div class=\"codecolorer-container text default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">DB_HOST=localhost<br \/>\nDB_DATABASE=gantt<br \/>\nDB_USERNAME=root<br \/>\nDB_PASSWORD=yourpassword<\/div><\/div>\n<p>You should define the hostname, name of the database that we&#8217;ve created earlier, username, and a password to allow Laravel use the data from a database.<\/p>\n<p>The next step is to define the routes. Open the <em>app\/Http\/routes.php<\/em> file. Here&#8217;s the default routes configuration that you&#8217;ll find there:<\/p>\n<div class=\"codecolorer-container php default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">Route<span class=\"sy0\">::<\/span><span class=\"me2\">get<\/span><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'\/'<\/span><span class=\"sy0\">,<\/span> <span class=\"kw2\">function<\/span> <span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw1\">return<\/span> view<span class=\"br0\">&#40;<\/span><span class=\"st_h\">'welcome'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>Here&#8217;s what it means, in a nutshell. When you open the root folder of your website in a browser, the GET request will be performed. As a result, the <em>welcome<\/em> page from the <em>resources\/views<\/em> folder will be returned. In fact, the name of this file is <em>welcome.blade.php<\/em> but Laravel disregards file extensions. What we need to do is to tell Laravel that the previously created view, <em>gantt.php<\/em>, should be returned. The other step is to use <em>GanttController.php<\/em> to save and load data. All you need to do is to replace the existing route with the following:<\/p>\n<div class=\"codecolorer-container php default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\">Route<span class=\"sy0\">::<\/span><span class=\"me2\">get<\/span><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'\/'<\/span><span class=\"sy0\">,<\/span> <span class=\"kw2\">function<\/span> <span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw1\">return<\/span> view<span class=\"br0\">&#40;<\/span><span class=\"st_h\">'gantt'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<br \/>\nRoute<span class=\"sy0\">::<\/span><span class=\"me2\">match<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">'get'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'post'<\/span><span class=\"br0\">&#93;<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'\/gantt_data'<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;GanttController@data&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>One more step before we can run the project. Laravel protects your application from cross-site request forgeries by generating a CSRF \u201ctoken\u201d for each active user session managed by the application. You can read more about the mechanisms of protection on this page if you want, but what we need to do now is to exclude one particular URI from CSRF protection. The one that triggered when created data is supposed to be saved. We need to add a proper value to the $except property in this file <em>app\/Http\/Middleware\/VerifyCsrfToken.php<\/em>:<\/p>\n<div class=\"codecolorer-container php default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">protected<\/span> <span class=\"re0\">$except<\/span> <span class=\"sy0\">=<\/span> <span class=\"br0\">&#91;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'gantt_data'<\/span><br \/>\n<span class=\"br0\">&#93;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>That&#8217;s it! Now we can test the application.<\/p>\n<h2><b>Running the Application<\/b><\/h2>\n<p>\nOpen the root directory of your project and run:<\/p>\n<div class=\"codecolorer-container text default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">php artisan serve<\/div><\/div>\n<p>Here&#8217;s the typical output:<\/p>\n<div class=\"codecolorer-container text default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">Laravel development server started on http:\/\/localhost:8000\/<\/div><\/div>\n<p>Open http:\/\/localhost:8000\/ in your browser and you&#8217;ll see the working Gantt chart:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2016\/01\/Gantt-chart-with-Laravel.png\" alt=\"Gantt chart with Laravel\" width=\"600\" height=\"205\" class=\"aligncenter size-full wp-image-3189\" srcset=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2016\/01\/Gantt-chart-with-Laravel.png 600w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2016\/01\/Gantt-chart-with-Laravel-300x103.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Here are the tasks from the database dump file that we&#8217;ve imported earlier. You can edit them or create your own, using the \u201c+\u201d button.<\/p>\n<p>That&#8217;s all. We hope you have enjoyed the tutorial. The final application logic was not the goal of this article, but the interface built here is a good start for creating a fully-functional web application. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Our developers always try to provide you with the possibility to use our components in different ways. In this article, we&#8217;ll talk about dhtmlxGantt. We&#8217;ll learn how to use &#8230;<\/p>\n","protected":false},"author":2,"featured_media":3802,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,71,1,38],"tags":[33,20,14,60,46],"class_list":["post-3187","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-posts-for-codeproject-com","category-tutorials","category-uncategorized","category-visible","tag-all-posts","tag-gantt","tag-tips","tag-integrations-gantt","tag-laravel"],"_links":{"self":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/3187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/comments?post=3187"}],"version-history":[{"count":2,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/3187\/revisions"}],"predecessor-version":[{"id":8860,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/3187\/revisions\/8860"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/media\/3802"}],"wp:attachment":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/media?parent=3187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/categories?post=3187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/tags?post=3187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}