title: Undefined property in Laravel using Eloquent
body: <p>I have a problem when use Eloquent.</p>
  
  <p>This is the error message. </p>
  
  <pre><code>Undefined property: Illuminate\Database\Eloquent\Collection::$refunds
  </code></pre>
  
  <p>This is My model.
     class Beneficiary extends Eloquent {</p>
  
  <pre><code>public function refunds(){
      return $this-&gt;hasMany('Refund');
      }
  } 
  
  class Refund extends Model {
    protected $guarded = array();
  
    public static $rules = array(
      'request_id' =&gt; 'required',
      'beneficiary_id' =&gt; 'required',
      'concept' =&gt; 'required',
      'date' =&gt; 'required | date_format:Y-m-d',
      'amount' =&gt; 'required | min:-1 | numeric',
      'deductible_amount' =&gt; 'required | numeric',
      'max_applied' =&gt; 'required | numeric',
      'yearly_balance' =&gt; 'required | numeric',
      'payment_amount' =&gt; 'required | min:-1 | numeric',
      'payment_date' =&gt; 'required | date_format:Y-m-d',
  );
  
    public function beneficiary(){
      return $this-&gt;belongsTo('Beneficiary','beneficiary_id');
    }
  
   public function request(){
      return $this-&gt;belongsTo('Models\Request','request_id');
    }
  }
  </code></pre>
  
  <p>And this is my Model.</p>
  
  <pre><code>class HomeController extends BaseController {
     public function getIndex(){
  
      $requests = Requisition::with(array(
          'refunds' =&gt; function($refundsQuery){
                  $refundsQuery-&gt;with(array(
                      'beneficiary' =&gt; function($beneficiaryQuery){
                              $beneficiaryQuery-&gt;with(array('beneficiary', 'holder'));
                          }
                  ));
              },
          'policy' =&gt; function($policyQuery){
                  $words=explode(' ',trim(Input::get('policy_code')));
  
                  $policyQuery-&gt;where('code','LIKE','%'.$words[0].'%');
  
                  for($i=1;$i&lt;count($words);$i++){
                      $policyQuery-&gt;orWhere('code','LIKE','%'.$words[$i].'%');
                  }
  
              },
          'refunds' =&gt; function($refundsQuery){
              $refundsQuery-&gt;with(array(
                  'beneficiary' =&gt; function($beneficiaryQuery){
                      $beneficiaryQuery-&gt;with(array('beneficiary','rut'));
                  }
              ));
          }
      ));
  
  
  
      if(Input::has('request_number')){
          $words=explode(' ',trim(Input::get('request_number')));
  
          $requests-&gt;where('number','LIKE','%'.$words[0].'%');
  
          for($i=1;$i&lt;count($words);$i++){
              $requests-&gt;orWhere('number','LIKE','%'.$words[$i].'%');
          }
      }
  
      if(Input::has('policy_code')){
          $requests-&gt;whereHas('policy', function($policyQuery){
              $words=explode(' ',trim(Input::get('policy_code')));
  
              $policyQuery-&gt;where('code','LIKE','%'.$words[0].'%');
  
              for($i=1;$i&lt;count($words);$i++){
                  $policyQuery-&gt;orWhere('code','LIKE','%'.$words[$i].'%');
              }
          });
      }
  
      if(Input::has('rut')){
              $person = Person::where('rut', Input::get('rut'))-&gt;get();
              $beneficiary = Beneficiary::where('rut',Input::get('rut'))-&gt;get();
              $refunds = $beneficiary-&gt;refunds; //Error
      }
  
      $requests = $requests-&gt;paginate(10);
  
      return View::make('home.index',array(
          'requests'=&gt;$requests,
          'policy_code' =&gt; Input::get('policy_code'),
          'request_number' =&gt; Input::get('request_number'),
          'rut' =&gt; Input::get('rut')
      ));
  </code></pre>
  
  <p>In this line occurs the error <strong>$refunds = $beneficiary->refunds;</strong></p>
  
  <p>Any idea?</p>