Hi ZETTZ,
This can be achieved using a View Composer and a service provider.
Within a service provider, this could be the default AppServiceProvider but should probably be in it's own Service Provider.
There are a couple of ways of doing this, here is a basic example of using a closure to return something to your views. Within the boot method add:
View::composer('*', function ($view) {
// Logic here
$view->with('config', 'This is the config value');
});
The * acts as a wildcard, you could put a single view here, or an array list of views you want to make this available too. Using the wildcard, within your views would be a globally available variable named $config which will return the string value 'This is the config value'.
You can also use the route style syntax and include a view composer class to separate the logic into its own place.
// Using class based composers...
View::composer(
'*', 'App\Http\ViewComposers\ConfigComposer'
);
You would then create a view composer class and use the same $view->with logic to add your config.
Neil
Some resources: