storm icon indicating copy to clipboard operation
storm copied to clipboard

[WIP] Add support for generating env specific config caches

Open jaxwilko opened this issue 3 months ago • 3 comments

This PR implements support for Laravel's config:cache & config:clear commands.

The configs generated are env specific, which means that if you have config/banana/app.php with banana specific configs such as in a multi site setup you can use config:cache banana to specifically generate a cached config for that env.

By default, the env used will be the one provided via APP_ENV, or if not set environments.default, or if not set the value production.

Usage

  • Generate the default config: php artisan config:cache
  • Generate a specific config: php artisan config:cache banana
  • Clear the default config: php artisan config:clear
  • Clear a specific config: php artisan config:clear banana

TODO

  • [ ] Clean up the mess I made
  • [ ] Resolve todos
  • [ ] Test extensively

If anybody from https://github.com/wintercms/winter/issues/1297#issuecomment-2624578966 or https://github.com/wintercms/winter/issues/885#issuecomment-1512637325 would like to help test, that would be massively appreciated.

jaxwilko avatar Sep 03 '25 14:09 jaxwilko

@jaxwilko

Clear the default config: php artisan config:cache Clear a specific config: php artisan config:cache banana

Might it not rather be:

  • Clear the default config: php artisan config:clear
  • Clear a specific config: php artisan config:clear banana ??

damsfx avatar Sep 03 '25 16:09 damsfx

@jaxwilko

Clear the default config: php artisan config:cache Clear a specific config: php artisan config:cache banana

Might it not rather be:

  • Clear the default config: php artisan config:clear
  • Clear a specific config: php artisan config:clear banana ??

You are 100% correct, was in a rush to pick up my car from the garage, thank you ♥️

jaxwilko avatar Sep 03 '25 16:09 jaxwilko

This pull request will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this is still being worked on, please respond and we will re-open this pull request. If this pull request is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

github-actions[bot] avatar Nov 03 '25 01:11 github-actions[bot]