mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:54:05 +00:00
Use the Tenant models' getTenantKeyName() value (#461)
Don't assume the Tenant can be found with the `id` attribute. The Tenant model allows for setting a different Tenant key name through `getTenantKeyName()`, so lets use it to find the Tenant.
This commit is contained in:
parent
aee2a2e567
commit
683bb5a88d
1 changed files with 1 additions and 1 deletions
|
|
@ -80,7 +80,7 @@ class Tenancy
|
||||||
|
|
||||||
public function find($id): ?Tenant
|
public function find($id): ?Tenant
|
||||||
{
|
{
|
||||||
return $this->model()->find($id);
|
return $this->model()->where($this->model()->getTenantKeyName(), $id)->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue