You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At present I send a state to a factory to generate the recommendations. On the Resource when I attempt to generate a count on recommendations nothing is generated in the example output.
'value' => $this->whenCounted('recommendations', fn () => $this->recommendations_count),
However using the whenLoaded method generates the recommendation on the resource.
'value' => $this->whenLoaded('recommendations', fn () => $this->recommendations->count()),
Is whenCounted not supported by Scribe?
You need to understand that the people that maintain this (me) are devs just like you.😅 Laravel has many features; very hard for one person to know them all (and I rarely work with Laravel these days). I'd never even heard of that whenCounted method before now.
I'd ask you to dig into the Scribe source code a bit. I recall someone making an issue about whenLoaded some time back, and contributing a patch that led to it working in Scribe, so maybe you can do something similar in Scribe? There's probably a test for it somewhere, that you can use as a starting point.
Scribe version
4.8
Your question
At present I send a state to a factory to generate the recommendations. On the Resource when I attempt to generate a count on recommendations nothing is generated in the example output.
'value' => $this->whenCounted('recommendations', fn () => $this->recommendations_count),
However using the whenLoaded method generates the recommendation on the resource.
'value' => $this->whenLoaded('recommendations', fn () => $this->recommendations->count()),
Is whenCounted not supported by Scribe?
Docs
The text was updated successfully, but these errors were encountered: