TextColumn::make('matches')
->label('Matches')
->getStateUsing(function ($record) {
$matchCount = Matches::join('books', 'books.owner', '=', 'author.id')
->join('author_info', 'books.id', '=', 'author_info.host_id')
->where('author_info.prefix', '=', $record->prefix)
->count();
return $matchCount;
})
->sortable()
])
->defaultSort('matches', 'desc');
TextColumn::make('matches')
->label('Matches')
->getStateUsing(function ($record) {
$matchCount = Matches::join('books', 'books.owner', '=', 'author.id')
->join('author_info', 'books.id', '=', 'author_info.host_id')
->where('author_info.prefix', '=', $record->prefix)
->count();
return $matchCount;
})
->sortable()
])
->defaultSort('matches', 'desc');