I have a Filter configured for my Nova Resource. It applies the status:
public function apply(Request $request, $query, $value)
{
return $query->where('status', $value);
}
This works fine for the Table, but I have some Metrics configured on the Index as well. Is there a way for me the apply the active filter also on the Metric itself?
The is the Calculate method:
public function calculate(NovaRequest $request)
{
// apply the active Filter on this
return $this->count($request, Intake::class, 'type');
}
You can replace
Intake::class
with a Builder object.