title: With function not working to load has many relation data laravel Model Eloquent
body: <p>I have these two model. 
  This phone model is a common model which can be used to save and fetch the phone value for a user, customer, Employee and so on. So the meta_value is used to save the id of related model and meta_key is used to determine the model name relation.</p>
  
  <pre><code>/* Customer Model*/
  namespace App;    
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Database\Eloquent\SoftDeletes;
  
  class Customer extends Model {
      /**
       * Get the Phone List.
       */
      public function phones(){
          return $this-&gt;hasMany('App\Phone','meta_value', 'id')
                      -&gt;select('id as phone_id','contact_number as phone','contact_number','country_code','type','dial_code')
                      -&gt;where('meta_key','customer');
      }
  }
  /* Phone Model*/
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Database\Eloquent\SoftDeletes;
  
  
  class Phone extends Model {
      /**
       * Get the customer that owns the phone.
       */
      public function customer(){
          return $this-&gt;belongsTo('App\Customer', 'meta_value');
      }
  }
  </code></pre>
  
  <p>I can't get the data of phones with customer data. It always returns </p>
  
  <pre><code>[relations:protected] =&gt; Array
      (
          [phones] =&gt; Illuminate\Database\Eloquent\Collection Object
              (
                  [items:protected] =&gt; Array
                      (
                      )
  
              )
  
      )
  </code></pre>
  
  <p>In My controller I do the following code. </p>
  
  <pre><code>/*This is the case when I want to get the data for a single customer.*/
          $customer = Customer::find('448')-&gt;with('phones')-&gt;get();
          print_r($customer); // It will return all customers with no phones value.
  
          $customer = Customer::find('448');
          print_r($customer);die; // It will return a single customer whose id is 448 with no phones value.
  
          print_r($customer-&gt;phones);die; // I can get the values of phones by this
  
          $customer = Customer::find('448')-&gt;with('phones');
          print_r($customer);die; // It will crash my postman when i hit this.
  
          /*This is the case when I want to get the data for multiple customers.*/
          $customers = Customer::where('id', '&gt;', '447')-&gt;with('phones')-&gt;get();
          print_r($customers);die; // It will return multiple customer with empty phones value.
  
          // However when I iterate through the loop and get phones then I can get the phone value. 
          $customers = Customer::where('id', '&gt;', '447')-&gt;get();
          foreach ($customers as $customer) {
              $customer-&gt;phones = $customer-&gt;phones;
          }
          print_r($customers);die;
  </code></pre>
  
  <p>Only the iteration is working but I think that is not a good solution. Even I try load function but not working.</p>