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:
@@ -35,7 +35,7 @@ class LecturerTable extends DataTableComponent
|
||||
->sortable(),
|
||||
Column::make('Kurse')
|
||||
->label(
|
||||
fn($row, Column $column) => random_int(0, 100)
|
||||
fn($row, Column $column) => $row->courses_count
|
||||
),
|
||||
Column::make('')
|
||||
->label(
|
||||
@@ -47,6 +47,9 @@ class LecturerTable extends DataTableComponent
|
||||
|
||||
public function builder(): Builder
|
||||
{
|
||||
return Lecturer::query();
|
||||
return Lecturer::query()
|
||||
->withCount([
|
||||
'courses',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user