title: Cassandra DB connection on Laravel controller
body: <p><strong>EDIT:</strong></p>
  
  <p>I've tried using Laravel 5.2 and it's not throwing an error anymore. However my problem doesn't stop there as I can't encode the query result to json. I can't identify if cassandra is returning an array or whatever but I'm sure it ain't json.</p>
  
  <hr />
  
  <p>Original Post:</p>
  
  <p>I've tried <a href="https://laracasts.com/discuss/channels/1/php-driver-datastax-cassandra-db-how-to-use/replies/291448" rel="nofollow noreferrer">this</a> suggestion over at laracasts but it still won't let my laravel connect to cassandra.</p>
  
  <p>What I'm doing is put the sample code from <a href="https://github.com/datastax/php-driver#quick-start" rel="nofollow noreferrer">https://github.com/datastax/php-driver#quick-start</a>, put it on my controller, and modify the cql statement. The raw php works but when I put it on my controller it throws an error.</p>
  
  <p>The error I'm facing is:</p>
  
  <blockquote>
    <p>Undefined property: Cassandra\Cluster\Builder::$build</p>
  </blockquote>
  
  <p>Code that I used:</p>
  
  <pre><code>&lt;?php
  $cluster   = Cassandra::cluster()-&gt;withContactPoints('172.17.0.2')-&gt;build();
  $keyspace  = 'testspace';
  $session   = $cluster-&gt;connect($keyspace);
  $statement = new Cassandra\SimpleStatement(
      'SELECT * FROM users'
  );
  $future    = $session-&gt;executeAsync($statement);
  $result    = $future-&gt;get();
  
  echo "Connected to &lt;b&gt;" . $keyspace . "&lt;/b&gt; keyspace &lt;br&gt;&lt;br&gt;";
  
  foreach ($result as $row) {
      printf("The id number &lt;b&gt;%s&lt;/b&gt; belongs to &lt;b&gt;%s %s&lt;/b&gt;. &lt;br&gt;", $row['user_$
  }
  </code></pre>
  
  <p>I'm guessing laravel is still trying to know where should it look for those functions even though they're php extensions.</p>
  
  <p>Laravel version: 5.3<br>
  Cassandra version: 3.9</p>