public function table(Table $table): Table
{
return $table
->query($this->getData())
->columns([
...
])
->filters([
Filter::make('is_complete')->label('Recently Completed')
->query(fn (Builder $query): Builder => Model::where('location_id', $this->location->id))
->toggle()
]);
}
public function getData()
{
return Model::where('location_id', $this->location->id)->where('is_complete', 0);
}
public function table(Table $table): Table
{
return $table
->query($this->getData())
->columns([
...
])
->filters([
Filter::make('is_complete')->label('Recently Completed')
->query(fn (Builder $query): Builder => Model::where('location_id', $this->location->id))
->toggle()
]);
}
public function getData()
{
return Model::where('location_id', $this->location->id)->where('is_complete', 0);
}