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

Simplify Reactable scopes API #102

Merged
merged 18 commits into from
Aug 6, 2019
Merged

Conversation

antonkomarev
Copy link
Member

Resolves #93

@antonkomarev antonkomarev added this to the v8.0.0 milestone Aug 3, 2019
@antonkomarev
Copy link
Member Author

antonkomarev commented Aug 4, 2019

@JFunu changed virtual columns prefix from reactions_ to {$type}_ in PR #97 and this PR changes it to more standardized reaction_{$type}_ to follow the same style with total counters prefix reaction_total_.

Article::query()
    ->joinReactionCounterOfType('Like')
    ->joinReactionCounterOfType('Dislike')
    ->joinReactionTotal()

It will produce attributes:

  • $article->reaction_like_count
  • $article->reaction_like_weight
  • $article->reaction_dislike_count
  • $article->reaction_dislike_weight
  • $article->reaction_total_count
  • $article->reaction_total_weight

@antonkomarev antonkomarev merged commit eb1dcae into master Aug 6, 2019
@antonkomarev antonkomarev deleted the change/reactable-scopes-api branch August 6, 2019 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make scopes easier to use
1 participant