TaufikRiontona
filtered colum value
Solved.
need to implement modifyqueryusing
->modifyQueryUsing(function (Builder $query, $livewire) {
$filter = @$livewire->tableFilters['Periode'];
if (!isset($filter['tahun'], $filter['bulan'])) {
return $query;
}
$date = Carbon::createFromFormat('Y-m-d', "{$filter['tahun']}-{$filter['bulan']}-01");
$startOfMonth = $date->startOfMonth();
$endOfMonth = $date->copy()->endOfMonth();
return $query->whereHas('timelinesRencana', function ($subQuery) use ($startOfMonth, $endOfMonth) {
$subQuery->whereBetween('date', [$startOfMonth, $endOfMonth]);
})->withCount([
'timelinesRencana' => function ($subQuery) use ($startOfMonth, $endOfMonth) {
$subQuery->whereBetween('date', [$startOfMonth, $endOfMonth]);
},
'timelinesRealisasi' => function ($subQuery) use ($startOfMonth, $endOfMonth) {
$subQuery->whereBetween('date', [$startOfMonth, $endOfMonth]);
}
]);
})
4 replies
Combining Relation Manager table with Parent table
share your VehicleMakeResoure code
try this.
https://filamentphp.com/docs/3.x/tables/grouping#grouping-by-a-relationship-attribute
use Filament\Tables\Table;
public function table(Table $table): Table
{
return $table
->groups([
'author.name',
]);
}
2 replies
Need Help, how pass parameters to relation manager?
Solve with this.
on resource
public static function getRelations(): array
{
return [
RelationManagers\ProjectsRelationManager::make([
'periode' => request()->route('periode') ?? now()->endOfMonth()->format('Y-m-d')
])
];
}
On RelationManager
public ?string $periode;
public function table(Table $table): Table
{
dd($this->periode);
}
4 replies