F
Filament10mo 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 Koch10mo 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
Anouar10mo ago
no
Anouar
Anouar10mo 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
Anouar10mo ago
i make all chapitre but last chapitre its get value
Dennis Koch
Dennis Koch10mo ago
Have a look at that screenshot. It's from Filament v1. We are at v3 now 😉
Anouar
Anouar10mo 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 Koch10mo ago
getStateUsing()
Thandruil
Thandruil10mo 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
Anouar10mo ago
some erreur
Dennis Koch
Dennis Koch10mo 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