Replies: 2 comments
-
Hello @woodspire Firstly, adjusting the Additionally, updating the Laravel documentation's Eloquent SoftDelete section to clarify that We could also consider introducing new methods tailored specifically for handling soft deleted models. Perhaps implementing Engaging with the Laravel community on this issue might also be helpful. Opening a discussion via GitHub issues or forums could gather additional insights and perspectives, ultimately leading to a more collaborative and widely accepted solution. By exploring these avenues, we can enhance the functionality of SoftDeletes within Laravel, providing developers with clearer documentation and more reliable methods for working with soft deleted models. What do you think about these ideas? |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response. I asked here instead of creating an issue or a PR because I don't want to spend time and then the ticket/PR is closed. I was thinking of adding a new property or method on the Model class to list the scopes that should be kept. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@taylorotwell
Adding the SoftDelete trait to the user model.
Both asserts fail, because fresh() & refresh() use a query WITHOUT scopes, which exclude the SoftDelete trait scope.
I think we should either:
Note: The returned model does contains the deleted_at attribute with a date value. $user->trashed() is correct.
Beta Was this translation helpful? Give feedback.
All reactions