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

refactor: change type data Collection to Arrayable #13

Merged
merged 1 commit into from
Dec 13, 2022
Merged

Conversation

axmad386
Copy link
Member

This PR change type checker of data from Collection to Arrayable. This also will close #12 since Collection and Model are implement Arrayable.

@@ -135,10 +135,10 @@ public static function validateOrFail(
}

/**
* Add data to response and transform according to its type.
*
* @param array|Collection|JsonResource|ResourceCollection $data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should keep the collection just because its more popular rather than Arrayable

@param array|Arrayable|Collection|JsonResource|ResourceCollection

@lakuapik lakuapik merged commit d112054 into main Dec 13, 2022
@lakuapik lakuapik deleted the support-model branch February 7, 2023 15:46
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.

Instance of Model not supported to be returned as data
2 participants