Custom View Namespaces

Posted on Updated on by Gergő D. Nagy

By default, our view files are stored in the resources/views folder, which is a perfectly fine place for them. But maybe sometimes we have another location where we store our blade files next to the original one. Fortunately, Laravel provides namespaced views with different locations.

// Add the namespace and a path
View::addNamespace('namespace', '/path/to/other/views');

// And use it like always

Looking for web dev job?
You can check them on Jooble.

Need a web developer? Maybe we can help, get in touch!