Numine
Numine
FFilament
Created by Numine on 1/8/2024 in #❓┊help
If you need to remove the 'x'/cancel /remove option from a Filter Indicator
Indicators[] = Indicator::make('Some Label')->removable(false);
5 replies
FFilament
Created by Numine on 8/11/2023 in #❓┊help
How do I use selectfilter to filter based on a column on another table.
I have figured out the solution, needed a query to check the column based on the existing relationship:

// From the Resource for A

SelectFilter::make('thename')
->multiple()
->options($theOptionsArray)
->query(
functions (Builder $query, array $data) {
if(count($data['values']) != 0)
$query->whereHas('relationBetweenA&B', fn (Builder $query) => $query->whereIn('columnOnB', $data['values']));
}
)

// From the Resource for A

SelectFilter::make('thename')
->multiple()
->options($theOptionsArray)
->query(
functions (Builder $query, array $data) {
if(count($data['values']) != 0)
$query->whereHas('relationBetweenA&B', fn (Builder $query) => $query->whereIn('columnOnB', $data['values']));
}
)
4 replies