How can you remove null or empty values with a transformer? #938
Unanswered
francoism90
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Does anyone know how to transform a dataobject, but only keep the entries with a filled values?
I've tried to define a global transformer, but it doesn't seem to not accept
null
as match parameter.Edit: I just remembered Optional exists (https://spatie.be/docs/laravel-data/v4/as-a-data-transfer-object/optional-properties)..
Beta Was this translation helpful? Give feedback.
All reactions