title: How to get the latest post in Laravel? Only the latest
body: <p>I'm trying to pull the latest task to then set that progress after the latest is deleted to keep the progress updated.</p>
  <p>So, Imagine I have 20% of the task solved first, I add a progress which adds 30% and then, I got 50%. But, somehow I noticed that the progress made is not correct and I have to delete it, so, the progress has to go back to 20%</p>
  <p>A bit more visual:</p>
  <p>20% + 30% = 50%</p>
  <p>50% - 30% = 20%</p>
  <p>Being that said, In my controller I have the following:</p>
  <pre><code>public function destroy(Request $request, $id)
      {
          $id = Progress::where('id', $id)-&gt;first();
          $task = $id-&gt;task;
          $id-&gt;delete();
          $progress = $task-&gt;progresses-&gt;(dont know how to get the latest one ???);
          $task-&gt;progress = $progress-&gt;progress; /* we set the latest progress to be the current one */
          $task-&gt;update();
          $task-&gt;save();
          return response()-&gt;json([
          &quot;code&quot; =&gt; 200,
          &quot;message&quot; =&gt; &quot;Progress deleted successfully&quot;
          ]);
      }
  </code></pre>
  <p>How can I get the latest one to set it as the current?</p>