title: Laravel: How to search child relationship
body: <p>I feel this may be a simple question; but I can't, for the life of me, figure this out. I'm relatively new to Laravel, so bear with me. (And I have poured over the docs trying to find this one)</p>
  
  <p>I have a simple One to Many relationship setup and everything is working as intended.</p>
  
  <p>Membership hasMany Members Members belongsTo Membership</p>
  
  <p>While building a search, I was searching Members with great success, but realized I needed the expiration field set in Membership while displaying results. I'm currently using a Members::Query for the search. My question is, is there a way to pull parent information from a child relationship without having to rewrite all of the search logic and (cringe) having to submit a seperate query to pull each parent record?</p>
  
  <p>Here's the relavent code:</p>
  
  <p>Membership Model</p>
  
  <pre><code>class Membership extends Eloquent {
      protected $table = 'memberships';
      protected $fillable = array('expires');
  
      public function members() {
          return $this-&gt;hasMany('Member');
      }
  }
  </code></pre>
  
  <p>Member Model</p>
  
  <pre><code>class Member extends Eloquent {
  
      protected $table = 'members';
      protected $fillable = array('various','fields','here');
  
      public function membership() {
          return $this-&gt;belongsTo('Membership');
      }
  }
  </code></pre>
  
  <p>Search Function</p>
  
  <pre><code>public function searchMember()
  {
      $search = Input::get('search');
      $searchTerms = explode(' ', $search);
      $query = Member::query();
  
      $fields = array('firstname', 'middlename', 'lastname', 'email', 'dlnumber', 'membership_id');
  
      foreach ($searchTerms as $term)
      {
          foreach ($fields as $field)
          {
              $query-&gt;orWhere($field, 'LIKE', '%'. $term .'%');
          }
      }
  
      $results = $query-&gt;paginate(10);
      return View::make('members.search')-&gt;with('results', $results);
  }
  </code></pre>
  
  <p>As mentioned earlier, everything is working as expected, I just need to be able to pull one field from the parent Membership relationship.</p>
  
  <p>Thanks in advance!</p>
  
  <p>EDIT: After re-reading my question, I also wanted to point out that this is the only place in the application that isn't utilizing the Eloquent ORM and eager loading. If there's a way I could/should do this utilizing those, that would be best (imo)</p>