Skip to content

cannot get custom filtering to work #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
carolinecennis opened this issue May 24, 2017 · 1 comment
Open

cannot get custom filtering to work #14

carolinecennis opened this issue May 24, 2017 · 1 comment

Comments

@carolinecennis
Copy link

in ItemRepository I have a method:

    public function filterImages($query, $method, $clauseOperator, $value, $in)
    {
        if ($in) {
            call_user_func([$query, $method], 'product.categories', $value);
        } else {
            call_user_func([$query, $method], 'product.categories', $clauseOperator, $value);
        }
    }

when i filter for key "images" and value "image.jpg" this error always comes back:

"Argument 1 passed to Infrastructure\Database\Eloquent\Repository::filterImages() must be an instance of Optimus\Bruno\EloquentBuilderTrait, instance of Illuminate\Database\Eloquent\Builder given",

@kremuwa
Copy link

kremuwa commented Aug 7, 2017

You have to import a proper Builder class by adding the following line near other "use" statements in your file:
use Illuminate\Database\Eloquent\Builder;

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

No branches or pull requests

2 participants