title: Laravel: Throw error from controller
body: <p>I have a project and if I want to access <code>partner/X</code> I got <code>get property of non object</code> error, becouse I have less partners than X.</p>
  
  <p>My question. How to tell the controller, that <code>if the result of the modelquery is empty, than throw a 404 error</code>?</p>
  
  <p>My code is so far:</p>
  
  <pre><code>public function showPartner($id = 0){
  
     //Only allow numerical values    
    if ($id &gt; 0){
  
      $partner = Partner::find($id);
  
      if (empty($partner)){
          return ???
      }
    }
  }
  </code></pre>