0

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,
    ....
],
LoneWolfPR
  • 3,978
  • 12
  • 48
  • 84

1 Answers1

1

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.

James
  • 15,754
  • 12
  • 73
  • 91
  • I'm not usually a fan of messing with those properties because I usually assume there's a bigger problem. However, that did appear to do the trick for this instance. Maybe it's just an inefficient function. Thanks. – LoneWolfPR Jul 05 '16 at 02:32