mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
eager load grouped by relations
This commit is contained in:
@@ -53,6 +53,8 @@ trait CanGroupRecords
|
||||
return $query;
|
||||
}
|
||||
|
||||
$group->applyEagerLoading($query);
|
||||
|
||||
return $group->orderQuery($query, $this->getTableGroupingDirection() ?? 'asc');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user