1

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');
}
user1469734
  • 851
  • 14
  • 50
  • 81

1 Answers1

-2

You can replace Intake::class with a Builder object.

return $this->count($request, Intake::where('active', 1), 'type');
Robbin Benard
  • 1,542
  • 11
  • 15