Press "Enter" to skip to content

Recursion hell in blade

As a laravel developer, If you ever reached a situation where your website is just spinning with the loading in the browser tab, one of two things must have happened.

  1. There has been too much database query.
  2. Or, there is recursion happening.

Recursion means calling itself.

 

As you can see, you can apply it to function.

But particularly in laravel, it also tend to occur in blade templates (By necessity or by mistake).

For example.

Whats happening here is that it is extending itself. So, it will go inside loop where it will continuously extend itself until PHP execution time runs out.

So, if you ever run into this problem, check this situation too.

Be First to Comment

    Leave a Reply

    Your email address will not be published.