This works well on initial page load. However, when I use wp_ajax to include the loop partial (include \App\template_path(locate_template('views/partials/loop'));), The nested includes are causing a 500 error. If I comment out the 2 nested includes, the ajax function works as expected. I’m guessing that there may be an issue with the included file paths, but I’m not familiar enough with Blade to know how to debug this.
Any help greatly appreciated!
Edit: After initiating the ajax request the error thrown is Undefined variable: __env, coming from the Compiled View Path in the cache directory, which seems to be related to the illuminate package.