nova-filterable-cards
nova-filterable-cards copied to clipboard
Cannot declare the 'FilterableValue' to my card
Hi there
- Laravel 5.7
I am a bit confused on how to use this package. I have followed the readme:
This is my Metric Card:
NewFlowStatistics.php
use Beyondcode\FilterableCard\FilterableValue;
class NewFlowStatistics extends Value
{
use FilterableValue;
protected $filters = [
'flow_name' => [
'type' => 'text'
],
];
And then in the same file, this is my calculate() function:
public function calculate(Request $request)
{
return $this->value($request, FlowStatistics::class);
}
However this gives me below error:
Declaration of Beyondcode\FilterableCard\FilterableValue::aggregate($request, $model, $function, $column = NULL) should be compatible with Laravel\Nova\Metrics\Value::aggregate($request, $model, $function, $column = NULL, $dateColumn = NULL)
Fixed this by just using:
use Beyondcode\FilterableCard\Filterable;
use Filterable;
Instead of
use Beyondcode\FilterableCard\FilterableValue;
use FilterableValue;