Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Cannot declare the 'FilterableValue' to my card #4

Open
oliverbj opened this issue Nov 19, 2018 · 1 comment
Open

Cannot declare the 'FilterableValue' to my card #4

oliverbj opened this issue Nov 19, 2018 · 1 comment

Comments

@oliverbj
Copy link

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)

@oliverbj
Copy link
Author

Fixed this by just using:

use Beyondcode\FilterableCard\Filterable;
use Filterable;

Instead of

use Beyondcode\FilterableCard\FilterableValue;
use FilterableValue;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant