Normally we can get config via something like this:
$value = Config::get('app.timezone');
If want to get the config in the package, we can do something like this:
$value = Config::get('package::configfile')
How can I link the config file in my package so that I can use it that way?
Make sure to read the Package Development chapter in the documentation.
In Laravel 5 there are no config "namespaces" anymore. You just load your config like this in the Service Provider:
$this->publishes([
__DIR__.'/path/to/config/file.php' => config_path('package/file.php'),
]);
And access it like this:
Config::get('package.file');
or:
config('package.file');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With