Level 18
In the service provider, just use:
$this->mergeConfigFrom('path_to_your_config', 'your_key_name');
and it will add your config settings to config();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a custom package like this in my project
App
Services
MyPackage
Exceptions
config
config_to_be_published.php
config_for_internal_use.php
Facades
ServiceProvider.php
Service.php
Here, what is the best way to access config_for_internal_use.php within Service.php ?
Usually in laravel we would use config() to read the configs.
How should I go about this?
Please or to participate in this conversation.