-
Notifications
You must be signed in to change notification settings - Fork 34
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
Eager loading target
relationship on ActionEvent for a non soft-deleted model throws an exception
#5754
Labels
bug
Verified bug by the Nova team
Comments
Based on my test this seems to be an issue from the Framework especially
|
crynobone
added
pending
Issues that are pending triage
bug
Verified bug by the Nova team
and removed
pending
Issues that are pending triage
labels
Jul 28, 2023
Nevermind, this is under issue with Nova source code. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description:
The issue is related to the
target(): morphTo
relationship on the ActionEvent object.The relationship implementation assumes that the
target
model has aSoftDeletes
trait, which in some cases it doesn't.Trying to eager load a model that doesn't use the
SoftDeletes
trait will throw aBadMethodCallException
with the following error message:Call to undefined method Illuminate\Database\Eloquent\Builder::withTrashed()
.Detailed steps to reproduce the issue on a fresh Nova installation:
ActionEvent::with('target')->where('actionable_type', (new NonSoftDeletedModel)->getMorphClass())->get()
The text was updated successfully, but these errors were encountered: