@hala I don't know your whole code, but you propably want to get count of questions from your tag, but you need get item of tag for it.
Number::make('Name' , function () use ($tag) {
return $tag->questions()->count();
}),
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i want to make query in fields i used this but it's return fix value in resource
Number::make('Name' , function () { return \App\Tag::query()->with('questions')->count() }),
Is this not working ?
Number::make('Questions Count' , function () {
return $this->questions->count();
}),
Please or to participate in this conversation.