errer

Tables\Columns\TextColumn::make('Books')->getValueUsing( function ($author) { return (string)$author->books()->count(); } ), but I have this erreur Method Filament\Tables\Columns\TextColumn::getValueUsing does not exist. but I add use Filament\Tables\Columns\getValueUsing; and have some erreur
No description
10 Replies
Dennis Koch
Dennis Koch2y ago
but I add use Filament\Tables\Columns\getValueUsing;
Where did you get this from? That doesn't exist? Are you posting random ChatGPT code? 🤔
Anouar
AnouarOP2y ago
no
Anouar
AnouarOP2y ago
bestmomo
Laravel
Laravel Filament
Il existe un certain nombre de packages pour créer une administration pour Laravel dont l’officiel Nova (qui est payant). J’ai déjà parlé dans ce blog de Voyager, Orchid et Infyom. Je d…
Anouar
AnouarOP2y ago
i make all chapitre but last chapitre its get value
Dennis Koch
Dennis Koch2y ago
Have a look at that screenshot. It's from Filament v1. We are at v3 now 😉
Anouar
AnouarOP2y ago
can you tel my how this function in v3 Tables\Columns\TextColumn::make('Books')->getValueUsing( function ($author) { return (string)$author->books()->count(); } ),
Dennis Koch
Dennis Koch2y ago
getStateUsing()
Thandruil
Thandruil2y ago
Also it would be quite inefficient to calculate counts like this. It’s better to make it part of the query using an aggregate (withCount ) for example.
Anouar
AnouarOP2y ago
some erreur
Dennis Koch
Dennis Koch2y ago
If you have an error, share it. How do you expect us to help otherwise? And as Eric suggested this is very inefficient. Have a look at the count() method

Did you find this page helpful?