How to make Laravel 5 return 404 status code : <p>I am trying to get Laravel 5 (5.1.31) to return a http status response of 404 when a page is not found.  I have tried several things and it always returns 200.</p>

<p>In my controller I have this:</p>

<pre><code>else
   {
   header('HTTP/1.0 404 Not Found');
   return view('errors.404);
   }
</code></pre>

<p>I have also tried:</p>

<pre><code>else
   {
   http_response_code(404);
   return view('errors.404);
   }
</code></pre>

<p>and </p>

<pre><code>else
   {
   abort(404, 'Page not found');
   }
</code></pre>

<p>I also tried putting this in the 404.blade</p>

<pre><code>@inject( 'response', 'Illuminate\Http\Response' )
{{ $response-&gt;status(404) }}
</code></pre>

<p>No success.  No matter what I try, Laravel returns 200.  How do I get it to return 404?</p>
