Support the ongoing development of →
Configuration Views Architecture
Last updated 1 year ago.

this works but is there anyway to make the views accessible in the config somewhere?

Do you mean is there a configuration value to set namespaces for Views? If so, no.

You could definitely do this, you could modify app/config/view.php to include:

return [
    // Other config values

    'namespaces' => ['foo' => 'path/to/foo/views'],

Then, in your app/start/global.php file (or a service provider, but that's outside the scope of this question):

foreach (Config::get('view.namespaces') as $namespace => $hint)
    View::addNamespace($namespace, $hint);
Last updated 1 year ago.

Hey that is an excellent answer :) is it conventional to do this? Or is this considered extending the framework.

Thanks for prompt and precise answers.

Last updated 1 year ago.

Sign in to participate in this thread!


Your banner here too?


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

Your logo here?

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

© 2024 - All rights reserved.