Laravel 4 Laravel身份验证筛选器在一台服务器上不工作

Laravel 4 Laravel身份验证筛选器在一台服务器上不工作,laravel-4,Laravel 4,我有一个奇怪的情况,我的身份验证过滤器在我的预生产服务器上被忽略了,但在现场和本地homestead机器上却没有 为了调试,我将两个文件完全减少到了最小 我的路线不那么壮观routes.php Route::get("/foo",['before'=>'foo',function(){return 'bar';}]); 在我的filters.php中,伏都教发生了 //die('if I uncomment this, causes the app to end here both li

我有一个奇怪的情况,我的身份验证过滤器在我的预生产服务器上被忽略了,但在现场和本地homestead机器上却没有

为了调试,我将两个文件完全减少到了最小

我的路线不那么壮观routes.php

Route::get("/foo",['before'=>'foo',function(){return 'bar';}]);
在我的filters.php中,伏都教发生了

//die('if I uncomment this, causes the app to end here both live and local');
Route::filter("foo",function($a,$b,$c){die("this is ignored on live but not on local");});
转到
/foo
显示,我希望应用过滤器并阻止栏出现

我完全搞不清楚这个问题的原因,基本上现在任何人都可以访问所有页面,即使没有登录

从现在开始我应该检查什么

我试过的

  • php artisan缓存:清除
  • php artisan转储自动加载
  • php artisan clear已编译
  • grep--include=\*.php-rnw-e“filters.php”
    返回
    /app/start/global.php:97:require-app\u-path()。“/filters.php”

不幸的是,我的预生产服务器将环境设置为
测试

Laravel有一个名为testing的环境检查


为了解决这个问题,我将环境重命名为preproduction

Laravel有一个过滤器减速器。检查您的环境设置
if ($app['env'] == 'testing')
{
$router->disableFilters();
}