mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
table counts added
This commit is contained in:
@@ -27,7 +27,7 @@ class CourseTable extends DataTableComponent
|
||||
->sortable(),
|
||||
Column::make("Termine")
|
||||
->label(
|
||||
fn($row, Column $column) => '<strong>'.$row->events->count().'</strong>'
|
||||
fn($row, Column $column) => '<strong>'.$row->events_count.'</strong>'
|
||||
)
|
||||
->html()
|
||||
->sortable(),
|
||||
@@ -43,6 +43,9 @@ class CourseTable extends DataTableComponent
|
||||
public function builder(): Builder
|
||||
{
|
||||
return Course::query()
|
||||
->withCount([
|
||||
'events',
|
||||
])
|
||||
->whereHas('events.venue.city.country',
|
||||
fn($query) => $query->where('countries.code', $this->country));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user