F
Filament14mo ago
Anouar

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 Koch14mo 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
AnouarOP14mo ago
no
Anouar
AnouarOP14mo 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
AnouarOP14mo ago
i make all chapitre but last chapitre its get value
Dennis Koch
Dennis Koch14mo ago
Have a look at that screenshot. It's from Filament v1. We are at v3 now 😉
Anouar
AnouarOP14mo 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 Koch14mo ago
getStateUsing()
Thandruil
Thandruil14mo 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
AnouarOP14mo ago
some erreur
Dennis Koch
Dennis Koch14mo 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
Want results from more Discord servers?
Add your server