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

[11.x] Set HasAttributes@casts() array generics #53024

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

cosmastech
Copy link
Contributor

@cosmastech cosmastech commented Oct 3, 2024

I keep having to add this type-hint to my models on a project. Figured I would help myself (and others) out.

Copy link
Contributor

@Jubeki Jubeki left a comment

Choose a reason for hiding this comment

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

As the array does not only contain strings, but could also contain a custom cast like https://laravel.com/docs/11.x/eloquent-mutators#custom-casts, this would be better in my opinion.

Sorry my bad, it will still be referenced as a class string.

@taylorotwell taylorotwell merged commit 2880c30 into laravel:11.x Oct 3, 2024
33 checks passed
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