Maximum function Nesting Level of 100 reached — Model Exception

Last Updated at : June 7, 2017 By - Usama Muneer | 1951

    Laravel is of no doubt one of the great PHP Frameworks to work with, but sometimes it go crazy and through some ludicrous errors and warnings, which sometimes most of the developers has no idea of how to fix it.

    Since I’ve been into Developing some cool stuff in Laravel, this is so far a rarely new Error to me, so like most of other people, i just googled the query and found some relative links, but still couldn’t find a proper solution. The common answer I found out which some people have suggested to just increase the nested level in php.ini.

    xdebug.max_nesting_level = 300

    Which is not supposed to be the perfect solution what i was looking for.

    I’ve found several people facing this problem even in the fresh installation ofLaravel Homestead or Forge Server.

    Laravel Homestead currently has a default max_nesting_level of 250.

    Just to be clear, this is not a bug in Laravel, Symfony or anything else. It only occurs when XDebug is installed.

    Although this particular problem could certainly be caused by some bad code.

    But wait, before digging in deeper, let’s first understand what this xDebug max_nesting_level thing exactly is:

    max_nesting_level=100 means that 100 or more functions are called recursively. This is not a high figure as such and later versions of XDebug (>= 2.3.0) have raised this limit to 256. See here:

    http://bugs.xdebug.org/bug_view_page.php?bug_id=00001100

    But this probably not the xDebug issue at all, i found a simple solution to this.
    just run the following command in your root directory, and this will wipe away this error for sure.

    composer update

    simple enough, eh?

    If you liked my blog, do follow me on twitter.

    blog user
    Usama Muneer

    A web enthusiastic, self-motivated & detail-oriented professional Full-Stack Web Developer from Karachi, Pakistan with experience in developing applications using JavaScript, WordPress & Laravel specifically. Loves to write on different web technologies with an equally useful skill to make some sense out of it.

    Related Posts

    Laravel Live Islamabad, ended on 24th Nov'18 & we got a lot to learn from the top-notch of speakers & influencers. Thanks to the sponsors for pulling off such a great event in the capital of Pakistan.

    Previously Localization in Laravel was done by creating separate directories for each locales and place in under resources/lang/ and add key value pairs to every single keyword in a number of files as per their modules.

    Another #LaraconUS in the books & It was the 6th instalment of #LaraconUS happened at Chicago with full swing & we got a lot to learn this time with exceptional line of speakers and never-ending community support by fellow Artisans

    Laravel is one of a famous and widely used PHP framework which is growing with immense pace since its version 4.2. Learning Laravel & Setting up your application locally is not much of a difficult task but when it comes to deployment, developers often find it a bit tricky to handle.