title: Add a key value pair to results from Laravel Model with pagination
body: <p>In my controller i am calling my invoices model which is doing a paginated selected. After i get the results i then need to loop through each result and add a key => value pair to the original results. 
  I have my laravel set up in config/database.php to get results as arrays:</p>
  
  <p>'fetch' => PDO::FETCH_ASSOC,</p>
  
  <p>My code in my controller is </p>
  
  <pre><code>    $invoices = Invoices::getInvoices($clientId);
      $total = 0;
      foreach($invoices as $key=&gt;$inv) {
  
          $payments = Payments::getPaymentAmount($inv['InvoiceId']);
  
          foreach($payments as $pmt) {
  
                  $total += $pmt['Pmt_Amount'];
  
          }
  
          $invoices[$key]['total'] = $total;
      }
  </code></pre>
  
  <p>My Invoices Model is:</p>
  
  <pre><code>public static function getInvoices($clientId)
  {
     $invoices = DB::table('invoices')
      -&gt;where('ClientId', '=', $clientId)
      -&gt;paginate(25);
     return $invoices;
  }
  </code></pre>
  
  <p>and my payments model</p>
  
  <pre><code>public static function getPaymentAmount($invoiceId)
  {
      $payment = DB::table('payments')
          -&gt;select('Pmt_Amount', 'PaymentStatusId')
          -&gt;where('InvoiceId', $invoiceId)
          -&gt;get();
  
      return $payment;
  }
  </code></pre>
  
  <p>When i try to add 'total' to the invoices array i get the following error</p>
  
  <p>Indirect modification of overloaded element of Illuminate\Pagination\LengthAwarePaginator has no effect</p>