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 support for relationships #17

Merged
merged 18 commits into from
Mar 4, 2022

Conversation

christoph-kluge
Copy link
Contributor

Thanks for creating this package 👍

I'm adding this realtionship-support because I'm in need of this in a tenant-based stats-approach. The following discussion #5 was very useful for it. After some initial thoughts on how to achieve this I remembered how easy it is with spatie/laravel-query-bullder. I took this as an inspiration.

Feel free to follow up on the commit messages which may explain some changes.

… in a real-world application it seems more expressive by adding it on constructor-level rather than on method-level
Copy link
Member

@AlexVanderbist AlexVanderbist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the great PR! Well documented and adds a lot of value 👌 I've added a couple questions in the PR review but apart from that, this looks good to merge

src/Models/Stat.php Outdated Show resolved Hide resolved
database/migrations/create_stats_tables.php.stub Outdated Show resolved Hide resolved
tests/StatsWriterTest.php Outdated Show resolved Hide resolved
@christoph-kluge
Copy link
Contributor Author

@AlexVanderbist thanks for reviewing 👍 In my opinion we're good to go.

After looking at the existing code I saw that StatsQuery->getPeriodTimestampFormat is open to public but only used internally. Since we'll be increasing to 2.x I would consider moving this to protected.

What do you think?

@AlexVanderbist
Copy link
Member

Perfect, LGTM! I'll merge, make getPeriodTimestampFormat protected and tag 2.0.0! Thanks for your great work on this :D

@AlexVanderbist AlexVanderbist merged commit 0ca7b61 into spatie:main Mar 4, 2022
@christoph-kluge christoph-kluge deleted the relationships branch March 4, 2022 12:40
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.

2 participants