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

[6.x] Add custom deleted_at column name for assertSoftDeleted #30111

Merged
merged 2 commits into from
Sep 27, 2019

Conversation

dwightwatson
Copy link
Contributor

This fixes issue #30110 where it isn't possible to use assertSoftDeleted if you're using a column name other than deleted_at. This allows the custom column name to be passed into the assertion, and it also adds support if you pass in a model instance.

A few things to note:

  • I updated the model check to also include that it uses the SoftDeletes trait. It wasn't required previously but now that we call getDeletedAtColumn() we want to be sure that the method will be there. This would be backwards incompatible if you were using this assertion but not using the SoftDeletes trait, but I don't think that would be expected behaviour.

  • I've popped $deletedAtColumn on as the last argument to the method so as not to break anything. However I have a gut feeling it should rather be between the $data and $connection arguments. Curious as to your thoughts in regard to this.

@dwightwatson
Copy link
Contributor Author

That failure on 7.4 doesn't appear to be relevant, hopefully a rebuild will clear it up.

@driesvints
Copy link
Member

@dwightwatson rebuild it for your

@taylorotwell taylorotwell merged commit 156a7c5 into laravel:6.x Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants