Comments (4)
from multitenancy.
Thanks for replying to this on the weekend. I can confirm the trait is on the model.
I have echoed out the apply method to see if it was exiting early or anything.
public function applyTenantScope(Model $model)
{
echo 'reached 1, ';
if (is_null($this->tenant)) {
$this->deferredModels->push($model);
return;
}
echo 'reached 2, ';
if ($this->tenant->domain === 'admin') {
return;
}
echo 'reached 3, ';
$model->addGlobalScope('tenant', function (Builder $builder) use ($model) {
echo 'reached 4, ';
$builder->where($model->qualifyColumn('tenant_id'), '=', $this->tenant->id);
});
echo 'reached 5, ';
}
That results in the following output "reached 1, reached 1, reached 2, reached 3, reached 5,"
For some reason the addGlobalScope function is not being invoked?
from multitenancy.
Is there any reason this function would be skipped?
$model->addGlobalScope('tenant', function (Builder $builder) use ($model)
from multitenancy.
When setup correctly, I can't imagine an instance where that'd be the case. If you are able to provide a repo of your code, I can review it and see where things are going wrong!
from multitenancy.
Related Issues (20)
- Problem bigincrements HOT 4
- Question about this package HOT 2
- Question about routes HOT 3
- Accessing the current tenant?
- Class RomegaDigital\Multitenancy\Middleware\GuestTenantMiddleware does not exist HOT 5
- Cannot scoping based on tenants HOT 4
- Relation HOT 2
- Password resets... HOT 3
- Add styleci & travis
- User reset password link sending base domain HOT 3
- Tenant::createMany not found, can't get it to work HOT 1
- Custom UnauthorizedException Messages HOT 1
- Domains HOT 4
- must be an instance of App\User, instance of App\Domain\User given HOT 1
- Event on Tenant Match HOT 2
- have simple question HOT 6
- Making routes bypass the tenant middleware HOT 1
- php artisan multitenancy:super-admin <email> User model \App\User can not be found! HOT 2
- Leaking tenant session data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multitenancy.