repository icon indicating copy to clipboard operation
repository copied to clipboard

Support for withTrashed() and onlyTrashed() ?

Open avramovic opened this issue 8 years ago • 0 comments

I'm using SoftDeletes on my model and if I try to query trashed models it doesn't seem to work.

First I've tried this:

$item = $itemRepo->withTrashed()->all();

It says there is no method withTrashed() on my repository. Then I tried to make criteria:

...
public function apply($model, Repository $repository) {
  return $model->withTrashed();
}
...

...but it says there is no method withTrashed() on Builder class. It seems $model here is the query builder, not the model itself.

Same goes for onlyTrashed(). Is there any way to use these methods with your Repository package?

avramovic avatar Oct 12 '16 23:10 avramovic