Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 4.2中某些情况下未显示错误页面_Php_Laravel_Laravel 4_Error Handling - Fatal编程技术网

Php Laravel 4.2中某些情况下未显示错误页面

Php Laravel 4.2中某些情况下未显示错误页面,php,laravel,laravel-4,error-handling,Php,Laravel,Laravel 4,Error Handling,我在global.php中有这个函数来查找错误 App::error(function(Exception $exception, $code) { Log::error($exception); }); App::missing(function(Exception $exception) { Log::error($exception); return Response::view('errors.missing', array(), 404); }); App

我在
global.php
中有这个函数来查找错误

App::error(function(Exception $exception, $code)
{
    Log::error($exception); 
}); 
App::missing(function(Exception $exception)
{
    Log::error($exception);
    return Response::view('errors.missing', array(), 404);
});

App::error(function(Illuminate\Database\Eloquent\ModelNotFoundException $exception)
{
    Log::error($exception);
    return Response::view('errors.missing', array(), 404);
});
这在
routes.php

App::error(function(Exception $e) {
    return Response::view('errors.missing', array(), 404);  
});
这个在控制器中

$user = User::where('id', $userId)->first();
if (!$user) {
        App::missing(404);
}
如果我转到url,比如:并且ID为13432的用户不存在,那么我就得到了404页面


但如果我访问url,比如:我什么都没有。。保持不变。为什么我得不到404页?

你的用户页路线是什么?请发布你的
routes.php
route::get('/user/{userId}',['uses'=>'AdminController@users“,”在“=>”管理“]之前)是因为需要ID,例如int吗?目标是对所有错误的URL和页面使用404。你能解释一下“保持页面不变”是什么意思吗?你的用户页面的路径是什么吗?请发布你的
routes.php
route::get('/user/{userId}',['uses'=>'AdminController@users“,”在“=>”管理“]之前)是因为需要ID,例如int吗?目标是对所有错误的URL和页面使用404。你能解释一下“保持页面不变”是什么意思吗?