title: Custom 404 in Laravel 4.2 with Layout
body: <p>My page uses global layout and there are many views with own controllers which are using this layout. The view called from controller action like this:</p>
  
  <pre><code>class NewsController extends BaseController {
  
    protected $layout = 'layouts.master';
  
    public function index()
    {
      $news = News::getNewsAll();
  
      $this-&gt;layout-&gt;content = View::make('news.index', array(
          'news' =&gt; $news
      ));
    }
  }
  </code></pre>
  
  <p>I would like to create a custom 404 page in the same way because I need the normal page layout for nested custom 404 design. Is it possible somehow? The issue is that I cannot set the HTTP status code to 404 from controller, so it's just a soft-404 yet. I know that the proper way would be send the <code>Response::view('errors.404', array(), 404)</code> from <code>filter.php</code> in <code>App::missing()</code> but I cannot set the layout there just the view which is not enough. Or am I wrong and it's possible somehow?</p>
  
  <p>Thanks!</p>
  
  <p><strong>Update</strong>: 
  I've created a <a href="https://gist.github.com/SasSam/118fe3dcce2a2edcde0e" rel="nofollow">Gist</a> for this problem with the files what I use in the project. Maybe it helps more to understand my current state.</p>