eager load grouped by relations

This commit is contained in:
omaresmaeel
2024-01-05 19:41:03 +02:00
parent 876fd30c31
commit 7a1d95ce6a
2 changed files with 5 additions and 0 deletions
@@ -53,6 +53,8 @@ trait CanGroupRecords
return $query;
}
$group->applyEagerLoading($query);
return $group->orderQuery($query, $this->getTableGroupingDirection() ?? 'asc');
}
}
+3
View File
@@ -8,6 +8,7 @@ use Closure;
use DateTimeInterface;
use Filament\Support\Components\Component;
use Filament\Support\Contracts\HasLabel as LabelInterface;
use Filament\Tables\Columns\Concerns\InteractsWithTableQuery;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Model;
@@ -17,6 +18,8 @@ use Illuminate\Support\Arr;
class Group extends Component
{
use InteractsWithTableQuery;
protected ?string $column;
protected ?Closure $getDescriptionFromRecordUsing = null;