Laravel错误与404页面

im trying to implement code of 404 page in my website. Im using this code in my filters.php but i also tried to use in global.php

App::missing(function($exception)
{
 return View::make('404');
}

as a result im getting this error:

Symfony \ Component \ Debug \ Exception \ FatalErrorException
Call to a member function getAction() on a non-object

i do it an aother way. What is going to happen when 404 is raised is normally declared in app/start/global.php

It should looks like that :

App::error(function($exception, $code)
{
    switch ($code)
    {
        case 403:
            return Response::view('errors.403', array(), 403);
        case 404:
            return Response::view('errors.404', array(), 404);
    }
}

This just called the app/views/errors/404.blade.php anytime laravel raised a 404 or if you decide to manually call App::abort(404);

Hope it helps.

I googled more about this and how i understand it problem comes from nginx. could be? btw it is working without blade templating but i need it. so need to find out how to fix it

That look like in the views or composer of the layout or your 404 page. you have something like:

Route::getCurrentRoute()->getAction()

or

Route::current()->getAction()

Or as far I remember Route::getCurrentRoute when 404 would be null and then it explains your error...

I use to check if the current Route is instance of Route by:

$currentRoute = \Route::getCurrentRoute();
if ($currentRoute instanceof Route) {
    // Do What you want here
    $currentRoute->getAction()//...
}