title: How to Assign Column Names to the Laravel paginate() Method
body: <p>I have this in my Contact model:</p>
  
  <pre class="lang-php prettyprint-override"><code>public static function contacts($perPage = 10)
  {
      $order_type = '.desc';
      $order = Session::get('contact.order', 'first_name' . $order_type); // Set the default order to created_at DESC
      $order = explode('.', $order);
  
      $columns = array(
          'contacts.id as id',
          'contacts.first_name as first_name',
          'contacts.last_name as last_name',
          'contacts.telephone_number as telephone_number',
          'contacts.email as email',
          'accounts.company_name as account',
          'users.first_name as am_first_name',
          'users.last_name as am_last_name'
      );
  
      $contacts = DB::table('contacts')
          -&gt;leftJoin('accounts', 'account_id', '=', 'accounts.id')
          -&gt;leftJoin('account_managers', 'accounts.account_manager_id', '=', 'account_managers.id')
          -&gt;leftJoin('users', 'user_id', '=', 'users.id')
          -&gt;orderBy($order[0], $order[1])
          -&gt;paginate($perPage, $columns);
  
      return $contacts;
  }
  </code></pre>
  
  <p>It's not assigning my 'as' statement to the columns I want, which means I'm getting 'Column first_name is ambiguous.</p>
  
  <p>Can you not do this with the Paginate method?</p>
  
  <p>Cheers</p>