title: Retriving values trough a multi level query with eloquent relations in Laravel 8
body: <p>I'm trying to retrieve the latest records from a [MEASUREMENTS]table that is linked to a [SENSORS] table which is linked to a [RECORDERS] table.</p>
  <p>Something like: give the last measurement of all the sensors of a specific recorder</p>
  <p>I already defined the relations in the different models and succeeded in retrieving a multilevel collection (array) with <strong>all</strong> the values.
  But is there a way to only get the last measured values using Eloquent in Larvel 8</p>
  <p><strong>Recorder Model</strong></p>
  <pre><code>public function getSensorsRelation() {
  return $this-&gt;hasMany(Sensor::class, 'recorder_id', 'id');}
  </code></pre>
  <p><strong>Sensor Model</strong></p>
  <pre><code>public function getMeasurementsRelation() {
  return $this-&gt;hasmany('App\Models\measurement', 'sensor_id', 'id');}
  </code></pre>
  <p><strong>Controller query</strong></p>
  <pre><code>$recorderDataset = Recorder::where('id', $timeslot-&gt;recorder_id)
                     -&gt;with('getSensorsRelation.getMeasurementsRelation')
                     -&gt;get();
  </code></pre>
  <p><a href="https://i.stack.imgur.com/dkitz.png" rel="nofollow noreferrer">Database Schema</a></p>
  <p><a href="https://i.stack.imgur.com/RrFCI.png" rel="nofollow noreferrer">dd() after update answer from @Haridarshan</a></p>