Skip to content

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

3 participants