Support the ongoing development of Laravel.io →
posted 11 years ago
Packages

I am creating a package and in this package I want to allow the person using it to manually upload some files to the config directory that I created. The files are actually SSL certificates so I just need the path to get to them.

Anyone know how I can get the path to the config directory for the package? Or is there a better way to go around doing this?

Thanks

Last updated 3 years ago.
0

Why not just give them the option to publish config files (in app/config), and they can specify their path to the certificates there? The user placing files inside your package would be an anti-pattern because when you update your package and they run composer update their certificates will be wiped out.

php artisan config:publish vendor/package

You can access their values here using:

Config::get('package::certs.path');

Basically you don't need the path there because you can use Config::get() to access any values there, but if you wanted to know it, it would be:

app_path() . "/config/packages/vendor/package"
Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

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.

© 2025 Laravel.io - All rights reserved.