Summarize with using() yields TypeError

I have the following code:
TextColumn::make('balance')->formatStateUsing(fn ($state) => '$' . number_format($state / 100, 2))
->summarize(Summarizer::make()
->label('Total')
->using(fn (\Illuminate\Database\Eloquent\Builder $query): string => $query->sum('balance')))
TextColumn::make('balance')->formatStateUsing(fn ($state) => '$' . number_format($state / 100, 2))
->summarize(Summarizer::make()
->label('Total')
->using(fn (\Illuminate\Database\Eloquent\Builder $query): string => $query->sum('balance')))
I get this error:
App\Models\StatementTransaction::App\Models\{closure}(): Argument #1 ($query) must be of type Illuminate\Database\Eloquent\Builder, Illuminate\Database\Query\Builder given, called in /var/www/html/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
App\Models\StatementTransaction::App\Models\{closure}(): Argument #1 ($query) must be of type Illuminate\Database\Eloquent\Builder, Illuminate\Database\Query\Builder given, called in /var/www/html/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
I don't understand how that can be when I'm referencing the correct Builder instance.
0 Replies
No replies yetBe the first to reply to this messageJoin