-
-
Notifications
You must be signed in to change notification settings - Fork 102
Fix collection merging bug #97
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
Conversation
@Menkveld-24 good spot, and thanks for the PR. If you wouldn't mind extending the test surrounding this, that would be greatly appreciated 👍 |
Hi, sorry for the late response. Been busy these weeks and kinda forgot about it. I'll try to do so this week |
src/Processors/RouteProcessor.php
Outdated
return $collection->put('url', [ | ||
'query' => $rules->map(fn ($value) => array_merge($value, ['disabled' => false])), | ||
]); | ||
return $collection->mergeRecursive(collect([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to create a new collection to use mergeRecursive()
, a simple array should do.
@Menkveld-24 there's a failing test, are you able to fix it? |
Ofc! Somehow they didnt produce this error locally |
@tomirons Should be good rn |
Thank you @Menkveld-24 and @tomirons ❤️ |
The ->put('url') overwrites the url part of the collection instead of adding to it upon GET requests.
Would you also like me to extend the test for this? As the test only looks for the 'query' part inside the 'url'?