title: return user model with eager loading laravel
body: <pre><code> return $data =InteractiveSession::with('messages.user')-&gt;where('exercise_id',$exercise-&gt;id)-&gt;first();
  </code></pre>
  <p>This code will return data like below</p>
  <pre><code>{
  &quot;id&quot;: 1,
  &quot;exercise_id&quot;: 48,
  &quot;messages&quot;: [
      {
          &quot;id&quot;: 1,
          &quot;from_user&quot;: 69,
          &quot;message&quot;: &quot;Hi&quot;,
          &quot;interactive_session_id&quot;: 1,
          &quot;user&quot;: {
              &quot;id&quot;: 69,
              &quot;first_name&quot;: &quot;Jobin&quot;
          }
      }
  ]}
  </code></pre>
  <p>how can i return data like below??</p>
  <pre><code>{
  &quot;id&quot;: 1,
  &quot;exercise_id&quot;: 48,
  &quot;messages&quot;: [
      {
       &quot;id&quot;: 1,
        &quot;from_user&quot;:{
         &quot;id&quot;: 69,
         &quot;first_name&quot;: &quot;Jobin&quot;
          },
          &quot;message&quot;: &quot;Hi&quot;,
          &quot;interactive_session_id&quot;: 1, 
      }
  ]}
  </code></pre>
  <p>i have  tables interactivesession,message,users, using hasmany relation</p>