Tenant interface for the future of the package #543
masterix21
started this conversation in
Ideas
Replies: 2 comments
-
For example, using Laravel Jetstream, you could add tenant features to class Team extends \Laravel\Jetstream\Team implements IsTenant
{
use HasFactory;
use UsesLandlordConnection;
use HasTenantFeatures;
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Great idea, I would be ok with going through with this (and tagging a new major version for this) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @freekmurze, I have thought about laravel-multitenancy in the last few weeks.
The model
Tenant
is okay, but it is simplistic when you need to add a bit of complexity.My idea is that:
IsTenant
HasTenantFeatures
Starting from that, our start model
Tenant
can change like so:In the
HasTenantFeatures
, we move the methods:makeCurrent() : IsTenant
forget() : IsTenant
current() : ?IsTenant
checkCurrent() : bool
isCurrent(): bool
forgetCurrent(): ?IsTenant
getDatabaseName(): string
newCollection(array $models = []): TenantCollection
execute(callable $callable) : mixed
callback(callable $callable): \Closure
We replace all references from Tenant to IsTenant.
I'm sure these changes will lessen the difficulty reported by many users in the last few years.
What do you think about it?
PS: If you say
yes
, I'm ready to improve the code: no stress for you.References:
Beta Was this translation helpful? Give feedback.
All reactions