1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 10:34:04 +00:00

Use the Tenant models' getTenantKeyName() value

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:
Timothy 2020-07-14 23:09:19 +02:00 committed by GitHub
parent aee2a2e567
commit 5daf960b83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,7 +80,7 @@ class Tenancy
public function find($id): ?Tenant
{
return $this->model()->find($id);
return $this->model()->where($this->model()->getTenantKeyName(), $id)->first();
}
/**