Skip to content

[10.x] Update annotations in wrap method to accommodate Collection instances - #48746

Merged
taylorotwell merged 1 commit into
laravel:10.xfrom
salehhashemi1992:fix/docblock-wrap-method
Oct 18, 2023
Merged

[10.x] Update annotations in wrap method to accommodate Collection instances#48746
taylorotwell merged 1 commit into
laravel:10.xfrom
salehhashemi1992:fix/docblock-wrap-method

Conversation

@salehhashemi1992

@salehhashemi1992 salehhashemi1992 commented Oct 16, 2023

Copy link
Copy Markdown
Contributor

Update the annotations for the wrap method to reflect that the $data parameter can be either an array or an instance of the Collection class.

This method can handle Collections too:

if ($data instanceof Collection) {
    $data = $data->all();
}

@salehhashemi1992
salehhashemi1992 marked this pull request as ready for review October 16, 2023 20:53
@salehhashemi1992 salehhashemi1992 changed the title Update annotations in wrap method to accommodate Collection instances [10.x] Update annotations in wrap method to accommodate Collection instances Oct 16, 2023
Comment thread src/Illuminate/Http/Resources/Json/ResourceResponse.php Outdated
@salehhashemi1992
salehhashemi1992 force-pushed the fix/docblock-wrap-method branch from 2e1ea07 to 3fdea74 Compare October 17, 2023 07:28
@taylorotwell
taylorotwell merged commit 10ba03e into laravel:10.x Oct 18, 2023
timacdonald pushed a commit to timacdonald/framework that referenced this pull request Oct 24, 2023
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.

3 participants