Vigyata.AI
Is this your channel?
GithubGithub02

17 Return model when casting attribute

This is a simple fix, but it matters for fluent code. Setting an attribute on a model returns the model, and now even if you have a set attribute cast/mutator it won’t return null anymore—it will return the model as well.

Buy on Github

You'll be taken to Github to complete your purchase.

Pros

  • +Fixes unexpected null return when setting attributes with a set mutator/cast
  • +Makes chaining and fluent model updates more consistent

Cons

  • -Only relevant if you rely on the return value of setAttribute or fluent chaining

Featured in this video