Skip to content
This repository was archived by the owner on Mar 8, 2025. It is now read-only.
This repository was archived by the owner on Mar 8, 2025. It is now read-only.

Support for withTrashed() and onlyTrashed() ? #88

@avramovic

Description

@avramovic

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions