title: Catch function is null error PHP
body: <p>I have this db Query in Laravel</p>
  
  <pre><code>Planning::max('Date')-&gt;select('Date')-&gt;get();
  </code></pre>
  
  <p>and I get this error message: Call to a member function select() on null!</p>
  
  <p>How can I catch this error? When this error appears I need only a simple echo Information. When function select() is null then echo "This function is empty" or something like that.</p>