How to avoid extra queries created when related data is displayed?

The following adds a tooltip to show:
"booking xyz has 1 deal"
Or,
"booking xyz has 2 deals"
(implementing Str::plural) with the number of records in the related "deals" table.
Tables\Columns\TextColumn::make('deals_count')->counts('deals')
    ->color('primary')
    ->icon('heroicon-o-thumb-up')
    ->label('Deals')
    ->tooltip(fn (Booking $record): string => $record->name . " has " . $record->deals()->count() . " " . Str::plural('deal', $record->deals()->count())),

The above adds two extra queries, how can I still show the icon with the records count but avoid extra queries?
Any advice is much appreciated.
Thank you.
queries.jpg
Was this page helpful?