title: Laravel return one record where max value
body: <p>I'm trying to return one record with a max value as an object. When I do this:</p>
  
  <pre><code>public function highestExpense()
      {
          return auth()-&gt;user()-&gt;expenses()-&gt;max('amount');
      }
  </code></pre>
  
  <p>It works, and I get the highest value. But I want to have the whole record returned, so I also have access to the expense name, created_at, and so on.</p>
  
  <p>This didn't work for me:</p>
  
  <pre><code>return auth()-&gt;user()-&gt;expenses()-&gt;max('amount')-&gt;get();
  </code></pre>
  
  <p>It seems like a simple solution but the answer is nowhere to be found.</p>