Support the ongoing development of Laravel.io →
posted 9 years ago
Blade

Hello, I have a directory that has an unknown number of blade files inside it, I wish to include every single file in that directory in my main view. I had the idea of making a custom blade directive, and have that directive scan that folder, loop through the filenames, and echo the rendered view (something like echo (View::make("myfile")) Seems simple enough. But to my surprise, some weird unexpected behaviors started happening, my original view sometimes got repeated in a loop, sometimes the whole page froze and really unpredictable things started to occur because of that filter and it never rendered the views or printed them.

So any idea on how to make what I want happen? (include all the files in a given directory)

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mrj936 mrj936 Joined 13 Oct 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.