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:
class NewsController extends BaseController { protected $layout = 'layouts.master'; public function index() { $news = News::getNewsAll(); $this->layout->content = View::make('news.index', array( 'news' => $news )); } } 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 Response::view('errors.404', array(), 404) from filter.php in App::missing() but I cannot set the layout there just the view which is not enough. Or am I wrong and it's possible somehow?
Thanks!
Update: I've created a Gist for this problem with the files what I use in the project. Maybe it helps more to understand my current state.
$newsis empty?Response::view('layouts.errors', ['content' => View::make('errors.404')], 404)will use a layout file and have the$contentvariable set to the contents oferrors.404.Call to undefined function view()error. If I change it toResponse::view('layouts.master', ['content' => View::make('errors.missing')], 404);then the error will beError in exception handler: Undefined variable: shared (View:master.blade.php)