[11.x] Add applyAfterQueryCallbacks Support to Non-Mutator Cases in pluck Method #54268
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR modifies the pluck method to ensure that applyAfterQueryCallbacks is consistently applied, regardless of whether the column requires a mutator or casting.
Changes Made:
• Moved the applyAfterQueryCallbacks call to encompass non-mutator cases.
• Previously, applyAfterQueryCallbacks was only invoked when a mutator or cast was involved. With this change, it now applies to all results, providing more predictable and consistent behavior.
Benefits:
• Ensures that any callbacks registered with applyAfterQueryCallbacks are executed for all pluck results.
• Improves consistency in how pluck handles query results, regardless of column type or model-specific behavior.
Impact:
• Maintains backward compatibility with existing behavior.
• No breaking changes; the default functionality is preserved.