-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[10.x] Allow utilising withTrashed()
, withoutTrashed()
and onlyTrashed()
on MorphTo
relationship even without SoftDeletes
Model
#47880
[10.x] Allow utilising withTrashed()
, withoutTrashed()
and onlyTrashed()
on MorphTo
relationship even without SoftDeletes
Model
#47880
Conversation
@crynobone you mean all of the morphable models have to be soft deletable? |
Before this changes if we want to use This work well for application models but if a package provides morphable relationship and doesn't fully know which model would use it they would faced this issue. |
Why would a model do nothing when I may still be confused or something similar, but still... it is not good at all to call a method and do nothing... it should throw an error if it is not implemented but not implement an "empty" method, right? |
This has already been done on |
This is great, thank you very much, I have been dealing with this problem for a while now. |
This would be useful in some 3rd party packages as this has become an issue where it's not possible to define the relationship such as
$this->morphTo()->withTrashed()
unless all relationship usesSoftDeletes
trait:target
relationship on ActionEvent for a non soft-deleted model throws an exception nova-issues#5754Test without and with code changes