Closed kyranb closed 10 years ago
Can you try it with the branch at #3 and let me know if it's still broken?
@kyranb Actually, I've just merged #3 so just do a composer update
, check out the [updated reahttps://github.com/AuraEQ/laravel-multi-tenant/blob/master/README.mdME.md), and let me know if it's still an issue.
@HipsterJazzbo
Thanks! That solution looks pretty good and I can now seed the database without a problem now! (Also handy for when an admin user wants to be able to modify a certain tenants' record through a cms)
Only problem is that now when calling: TenantScope::setTenantId($tenantId)
I receive:
Class 'TenantScope' not found
Please forgive my ignorance as I'm new to Laravel. Should I be using use AuraIsHere\LaravelMultiTenant\ScopedByTenant;
on my Sessions/Login Controller? Or just on the models were I want to scope the data?
Thanks again!
You can do
use AuraIsHere\LaravelMultiTenant\TenantScope;
in your login controller. I'll probably add a facade in the next few days to make that easier, but for now that should work.
I'll close this issue now, and you can create a new issue if anything else is broken :)
Hi there, first of all, huge thanks for putting together this package!
One inconvenience is I have come across is that it breaks my seed files. (Everything else works a charm!)
In particular,when using:
ModelName::create
andphp artisan db:seed --class"ModelName"
I receive the error:[ErrorException] Trying to get property of non-object
Do you have any ideas on how to bypass the tenant scope whilst seeding a database?
Cheers