当前位置: 动力学知识库 > 问答 > 编程问答 >

php - Laravel 5.2, Maximum function nesting level

问题描述:

Please, help me to find what is going on.

I just set up a basic Laravel project. It's a new fresh Laravel project (5.2.29)

This is route.php

Route::get('/', '[email protected]x');

This is the test controller

class TestController extends Controller

{

public function index()

{

return view('home');

}

}

The home.blade.php is the one that comes with a fresh Laravel installation, the one printing "Laravel 5".

When I add the 'web' middleware, as following

Route::group(['middleware' => ['web']], function () {

Route::get('/', '[email protected]');

});

I get this error: "Maximum function nesting level of '100' reached, aborting!".

I read some thread about xDebug, so i add this line to xdebug.ini

xdebug.max_nesting_level = 1000

but nothing changed.

Any help? Or any suggestion on what else could I check?

Thank you

网友答案:

Try to remove web middleware, because now it applies automatically to all routes. So, since v5.2.27 you do not need to apply web middleware to avoid errors.

网友答案:

If you installed new application (5.2.27 at the moment of installation), you don't have to use web middleware group because it will be automatically applied, however if you installed version prior to 5.2.27 and then updated to 5.2.27 or later you still need to use it.

So first you need to verify app/Providers/RouteServiceProvider.php if there's web middleware group automatically applied. If yes, you should remove it from routes.php because you might get unexpected behaviour.

If it's not the case, you should verify what Middleware are included into web middleware group because some of them might cause problems

分享给朋友:
您可能感兴趣的文章:
随机阅读: