title: Laravel merging Eloquent result and array
body: <p>I'm trying to merge eloquent result and array because I need to add all possible filters that user can use for this model. If anyone have any other idea how to make it I really would be very thankful. Here is an example code:</p>
  
  <pre><code>&lt;?php
  
  class School extends Eloquent {
      protected $table = 'schools';
  
      public function listSchoolsEndUser()
      {
          $schools_data = new School;
  
          $schools_data = $schools_data-&gt;paginate(12);
  
          $filters = array( 
              'filters' =&gt; array(
                  'name' =&gt; 'Neshtoto'
              )
          );
  
          $schools_data = (object) array_merge(get_object_vars($schools_data), $filters);
  
          echo '&lt;pre&gt;';
          print_r( $schools_data );
          exit;
  
          return $schools_data;
      }
  </code></pre>
  
  <p>And the result is very interesting:</p>
  
  <pre><code>stdClass Object
  (
      [filters] =&gt; Array
          (
              [name] =&gt; Neshtoto
          )
  
  )
  </code></pre>