repository
repository copied to clipboard
Support for withTrashed() and onlyTrashed() ?
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?