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

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.
0

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.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.

© 2024 Laravel.io - All rights reserved.