Replies: 1 comment 2 replies
-
I don't think we want to support this. It's technically possible to have an empty string as a state value, and disallowing so would require a bunch of checks here and there. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to add states to a model that didn't have any. I created the migration, added the new column to
$casts
and$attributes
. This is it. Based on the title, you can probably guess what I have missed. Yes, I forgot to add values to the models that were already there.Of course our tests failed, rightly so. In the
StateCaster
'sget()
method you check if the value isnull
, not if it's an empty string. Which I have just found, can happen too.Although I classed this discussion as a bug, there might be a good reason to leave it as is. When I debugged why our tests failed, this did point me in the right direction. If you do think this is a bug though, let me know and I would be happy to raise a PR.
ps. thanks for all of your work. It is just insane how useful your packages are. Thanks, thanks, thanks!
Beta Was this translation helpful? Give feedback.
All reactions