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

[8.x] Allow to push and prepend config values on new keys #40723

Merged
merged 1 commit into from
Jan 31, 2022
Merged

[8.x] Allow to push and prepend config values on new keys #40723

merged 1 commit into from
Jan 31, 2022

Conversation

danesteve
Copy link
Contributor

The current behavior with config prepend and push is inconsistent when used with new/undefined keys:

config()->push('new_key', 'foobar');

seems to work fine.
However,

config()->prepend('new_key2', 'foobar');

throws:

TypeError: array_unshift(): Argument #1 ($array) must be of type array, null given

This PR addresses this issue.

Regards.

@taylorotwell taylorotwell merged commit cf8b275 into laravel:8.x Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants