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

Add method to find a models version at a specific time #43

Merged
merged 1 commit into from Oct 6, 2022

Conversation

marijoo
Copy link
Contributor

@marijoo marijoo commented Oct 6, 2022

This PR adds a versionAt() method which accepts a Carbon parseable timestamp and queries for the version that was valid at this specific time. Will return null if the timestamp is before the first version and will return the latest version if the timestamp is after the last one.

Also added some tests in VersionAtTest.php.

Queries a version at a specific time in the models history.
@overtrue overtrue merged commit 366a193 into overtrue:4.x Oct 6, 2022
@overtrue
Copy link
Owner

overtrue commented Oct 6, 2022

Thank you @marijoo

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.

None yet

2 participants