title: How do I create a dynamic array for a google combo chart with a database?
body: <p>I am trying to make a combo chart (googlecharts) which needs to be dynamic corresponding to database data.</p>
  
  <p>I got a database table called planning, which has the user_id, project_id and status of the planning.
  What I want to do is make a combo chart which will show the number of projects (status) per week for every employee.</p>
  
  <p>So the numbers that are hardcoded in the array are the numbers I want to make variable with the database data, but I have no idea how to begin building the array.</p>
  
  <p>I am using Laravel(Eloquent) if you are wondering what I am doing with the Models.</p>
  
  <pre><code>            $fd = Input::get('fd');
              $ld = Input::get('ld');
              $pid = Input::get('pid');
              $getPlanning = Planning::whereBetween('date', array($fd, $ld))-&gt;where('project_id', $pid)-&gt;get();
              $getEmployees = (Project::find($pid)-&gt;users);
              $employees[] = 'Days';
  
              foreach($getEmployees as $employee)
              {
                  $employees[] = $employee-&gt;firstname.' '.$employee-&gt;middlename.' '.$employee-&gt;lastname;
              }
  
              for($i=0; $i&lt;7; $i++)
              {
                  $dates[$i] = date("d-m-Y", strtotime($fd. ' + '.$i.' day'));
              }
  
              foreach($getPlanning as $v)
              {
                  $planning[] = [$v-&gt;user_id =&gt; $v-&gt;status];
              }
  
              for($j=0; $j&lt;count($employees); $j++)
              {
  
              }
  
              $table = array(
                  $employees,
                  [$dates[0], 0, 5, 9, 4, 6, 7],
                  [$dates[1], 3, 5, 5, 5, 5, 9],
                  [$dates[2], 1, 1, 3, 4, 6, 7],
                  [$dates[3], 3, 7, 8, 4, 6, 7],
                  [$dates[4], 7, 8, 9, 9, 9, 9],
                  [$dates[5], 3, 9, 9, 1, 2, 3],
                  [$dates[6], 3, 9, 9, 3, 4, 5]
              );
  
          return $getPlanning;
  </code></pre>