简体   繁体   中英

Laravel 5.2 with Sentinel 2 - Maximum function nesting level of '100' reached, aborting

In my base template of app.blade.php I do a simple check to see if the user is logged in. It looks like this:

@if (Sentinel::check())
    <li><a href="members.aspx">Members</a></li>
@else
    <li><a href="{{ url('/login') }}">Login</a></li>
    <li><a href="{{ url('/register') }}">Register</a></li>
@endif

This triggers the Maximum function nesting level of '100' reached, aborting . Any ideas why. I have the provider and facade defined properly in app.php. Like this:

'providers' => [
    ....
    Cartalyst\Sentinel\Laravel\SentinelServiceProvider::class,
    ....
],

'aliases' => [
    ....
    'Sentinel'  => Cartalyst\Sentinel\Laravel\Facades\Sentinel::class,
    ....
],

Whilst I can't say why you are getting this error, I can tell you how to fix it; you need to edit your xdebug.max_nesting_level in your php.ini .

Usually setting this to 200 or 300 does the trick, and is usually only an issue in local development where you are using xdebug.

You can set it like so; xdebug.max_nesting_level=200 or xdebug.max_nesting_level=300 .

More info on this setting can be found in the docs for xdebug.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM