-
Hello, I am just checking out this package, which really seems very interesting. When it comes to replace Requests and Api-Resources, I am wondering, how I would add conditional values like 'superpowers' => $this->when(auth()->user()->can('view', $this->resource), $this->superpowers), |
Beta Was this translation helpful? Give feedback.
Answered by
ahoiroman
Oct 30, 2021
Replies: 1 comment 1 reply
-
Well - I found it in the docs (the search does not work for me, so I did not find it before asking here). It can be found here: https://spatie.be/docs/laravel-data/v1/as-a-resource/lazy-properties#conditional-lazy-properties |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ahoiroman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well - I found it in the docs (the search does not work for me, so I did not find it before asking here).
It can be found here: https://spatie.be/docs/laravel-data/v1/as-a-resource/lazy-properties#conditional-lazy-properties