This is recommended if you can not change the function logic so that it decreases the amount of recursion. However, this solution also depends on the performance and memory impact analysis of your application / server / infrastructure.
That is to say, before you take this as the definitive solution, it would be interesting to re-evaluate the code at the points where the exception is thrown, if it is already optimized, keep the configuration.
But really, using Laravel a few times I came across the need to set this setting to 500, mainly because of extra packages that generate many features with xdebug turned on. However, I use this configuration only in development and test environment, in production I do not keep xdebug on, which allows me to keep the pattern for recursions.