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

Support for soft deleted models #143

Open
miloandco opened this issue Sep 14, 2022 · 0 comments
Open

Support for soft deleted models #143

miloandco opened this issue Sep 14, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@miloandco
Copy link

As far as I can see, it is not possible (when using Laravel Models) to filter on soft deletes.

For example, one month can have 10 new users created, but also have 3 users deleted. Then it would be useful to be able to somehow get a total of 10-3=7. Currently total would show up as 10, which can be both right or wrong, depending on your goal.

options([
  'withTrashed' => true, // Adds soft deleted rows to the result
  'onlyTrashed' => true, // Only soft deleted rows
  'calculateTotalAsNet' => true, // Subtracts soft deleted rows from total
])

Is this currently possible? Otherwise, it would make sense to add it to add some new options as displayed above. I can make a PR on it if anyone else needs it too.

@miloandco miloandco added the enhancement New feature or request label Sep 14, 2022
@miloandco miloandco changed the title [Feature Request] Support for soft deleted models Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant