This should allow to create fluent configuration usage for setting config values using PascalCase methods, first lower case verb defines whether it should get config or check if it exists or set it.
- When setting it returns instance of ConfigRepo.
- When getting it returns actual value or default fallback value.
- When checking if it has value it return boolean.
Example usage:
config/logging.php
, you want to add additional logger channel and add it to log stack on only specific service provider
class SpecificServiceProvider extends ServiceProvider {
// ...
public function boot() {
$config = $this
->app
->make('config');
$config
->setLoggingChannelsSentry([
'driver' => 'sentry',
'level' => 'error',
'bubble' => true,
])
->setSentryDsn(env('SENTRY_DSN'))
->setLoggingChannelsStackLaravelLog([...$config->getLoggingChannelsStackChannels(), 'sentry']);
}
}