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

Add a WithData trait #2

Merged
merged 5 commits into from
Nov 2, 2021
Merged

Add a WithData trait #2

merged 5 commits into from
Nov 2, 2021

Conversation

rubenvanassche
Copy link
Member

No description provided.

@@ -125,3 +125,36 @@ SongData::optional(null); // returns null
```

Underneath the optional method will call the `from` method when a value is given, so you can still magically create data objects. When a null value is given, it will return null.

## Quickly getting data from Models, Requests, ...
Copy link
Member

Choose a reason for hiding this comment

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

Let's also add an example for a request to make it very clear.

@emreakay
Copy link

good idea 👍

@rubenvanassche rubenvanassche merged commit e14ce17 into main Nov 2, 2021
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