Skip to content
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

Add where condition,Presenter not working? #761

Open
hby132500 opened this issue Sep 18, 2021 · 1 comment
Open

Add where condition,Presenter not working? #761

hby132500 opened this issue Sep 18, 2021 · 1 comment

Comments

@hby132500
Copy link

laravel 6
"prettus/l5-repository": "^2.6"

$repository = $this->repository->setPresenter(BorrowOrdersPresenter::class);
$borrowOrders` = $repository->where('sp_no',$sp_no)->paginate($this->getLimit());

image

@jojoarianto
Copy link

I have this problem too.

Things I realize, if you want to use setPresenter method you have to use method from RepositoryInterface instead laravel Illuminate\Database\Eloquent\Builder

So where method is come from Illuminate\Database\Eloquent\Builder.
The solution is use findWhere from repositoryInterface

You can see the contract here https://github.com/andersao/l5-repository/blob/master/src/Prettus/Repository/Contracts/RepositoryInterface.php

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