title: How to manipulate the laravel query builder output data using php
body: <p>Assume I have a simple laravel query builder. </p>
  
  <pre><code>$data = DB::table('users')-&gt;get();
  </code></pre>
  
  <p>(I want to use only query builder and not eloquent since the query will be very complex in reality)</p>
  
  <p>and the table fields are <code>userid, firstname, lastname, gender</code></p>
  
  <p>before I pass the  $data to my view I would like to modify the output data using PHP</p>
  
  <p>Say I wanted to add the prefix  Mr or Miss to firstname depending on the gender column or something like that.. (please don't suggest a pure sql solution since the complexity of the condition will be much more complex that just adding a prefix.. I had given this as a simple use case only)</p>
  
  <p>Is it possible ?</p>