title: Laravel 4: Eloquent relationship get all data
body: <p>I have 2 relationship data table; users table and memberdetails table.</p>
  
  <p>Users.php</p>
  
  <pre><code>class Users extends Eloquent{
  
      public function memberdetails()
      {
          return $this-&gt;hasOne('Memberdetails','user_id');
      }
  }
  </code></pre>
  
  <p>Memberdetails.php</p>
  
  <pre><code>class Memberdetails extends Eloquent{
  
      public function user()
      {
          return $this-&gt;belongsTo('Users','user_id');
      }
  }
  </code></pre>
  
  <p>When I try to retrieve data, with <code>$data = User::find($id);</code> I only get data from users table. </p>
  
  <p>Example of my blade form:</p>
  
  <pre><code>{{-- User's Name, stored on user table --}}
  {{ Form::text('name',null, array('id'=&gt;'name','class'=&gt;'form-control','required')) }}
  
  {{-- User's address, stored on member table --}}
  {{ Form::text('address',null, array('id'=&gt;'address','class'=&gt;'form-control','required')) }}
  </code></pre>
  
  <p>When I visit, <code>localhost/user/2/edit/</code>, the name field is populated, but address field is empty. How can I retrieve data from both tables and put into a form for editing?</p>
  
  <p>Thank you.</p>