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

Query Scopes #2

Open
HenkPoley opened this issue Mar 6, 2020 · 0 comments
Open

Query Scopes #2

HenkPoley opened this issue Mar 6, 2020 · 0 comments

Comments

@HenkPoley
Copy link

HenkPoley commented Mar 6, 2020

I understand that since there haven't been patches in this repo in years, that this code either does exactly what you need it to do, or you don't use it yourself anymore.

But I'd like to point to the existence of 'Query Scopes' in Laravel 4.2+. Which make it possible to automatically limit the retrieval of Model instances inside Eloquent, by attaching extra WHERE clauses to the data retrieval query. This would make groups an integrated part of your Models, that you wouldn't need to think (much) about, because a user can only retrieve Groupable Model instances that they have access to.

https://laravel.com/docs/7.x/eloquent#query-scopes

Just a suggestion in case you are working on a 'Groupable 2.0'.

Personally I'm just looking around for packages that add groups and RBAC rights to Laravel Models. And yours seems to be very much in the direction what I would need. Maybe I would additionally need hierarchical/nested groups. Depending on what we decide here you might get some Pull Requests. Thanks for making such code public.

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

No branches or pull requests

1 participant