Closed aronduby closed 7 years ago
+1
I'd love comments on this. I've been mulling around a bit of a refactor for this to make that sort of thing easier.
This feature would be very interesting.
+1
The next version that I've been testing with some of my stuff this week registers a separate, anonymous global scope for each tenant, enabling syntax like this:
Model::withoutScope('tenant_id')->get();
I'm still playing with the syntax a bit, and making sure it's well tested. Also looking at including some default middleware or something to help those people who are not as familier with the whole stack to get started.
I'll try to tag a beta today.
Hey guys. Try the v2.0-wip
branch. There are still a few tests missing, and I haven't yet had time to document the breaking changes, but just go through the readme and you should be okay. Mostly some classes and methods have been renamed to more closely match what they're actually doing now.
v2.0 uses anonymous global scopes under the hood, so you should be able to do something like
Model::withoutGlobalScope('tenant_id')->get();
My setup has 2 different tenant columns:
site_id
andseason_id
. For the large majority of things I want both of them. However there are a few queries where I actually want to ignore theseason_id
tenant while still keeping thesite_id
. Is there an easy way to do that that I'm just not seeing?It looks like I might be able to pull it off but it would involve globally removing it, doing the query, and then globally adding it back in as soon as it's done. That's just not pretty.