Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging configs for redis #51284

Closed
phpsa opened this issue May 3, 2024 · 3 comments
Closed

merging configs for redis #51284

phpsa opened this issue May 3, 2024 · 3 comments

Comments

@phpsa
Copy link

phpsa commented May 3, 2024

Laravel Version

11.6

PHP Version

8.2.18

Database Driver & Version

Postgres 11

Description

Combining configs, redis does not merge the new connection in, it overrides the entire section.

Steps To Reproduce

in config/database.php:

<?php
return [

    'redis' => [
     'geocode-cache' => [ 
            ...
        ],
];

I would expect it to add the geocode-cache as one of the options,
howver doing this sets the redis to that alone stripping out the defaults (ie clients, options etc.)

@crynobone
Copy link
Member

Hey there, thanks for reporting this issue.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?

Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

@phpsa
Copy link
Author

phpsa commented May 6, 2024

https://github.com/phpsa/lara-bug-report is the repo

note that there are 3 commits

  • #634d32e8eb6d21182a943fc7c02403af5f56acc0 from the installer
  • #480816e22010049ce6aafe5494b4373bb1c75960 removes the database.php config to allow the vendor one to work,
    Artisan tinker =-> config('database') shows all as expected
  • #786ecfd356573d8bda75a4c3a4f67f1b6a787ef6 adds just a new db and new redis connection,
    Artisan tinker =-> config('database') shows Database as expected, Redis not at all as expected

@driesvints
Copy link
Member

removes the database.php config

We don't officially support removing this file, sorry. Please always keep the original one in your app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants