Trying to pass some flag or parameter in a query to be processed inside a model hook #4900
-
Hello! I have a scenario in which I am filtering out soft deleted records for all calls of a model (hook) but for a specific query I want them to be present. I'd like something like this (but this doesn't work as query doesn't have "context")
How can I achieve this? Like, not only for deleted_at ideas (soft delete) but whenever I want to override a model hook from a controller or "conditionally call a hook"? |
Beta Was this translation helpful? Give feedback.
Answered by
arthurborgesdev
Mar 25, 2025
Replies: 1 comment
-
Managed to solve using query builder directly: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
arthurborgesdev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Managed to solve using query builder directly:
https://github.com/orgs/adonisjs/discussions/2359