1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 15:54:03 +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:
Timothy 2020-07-15 00:01:28 +02:00 committed by GitHub
parent aee2a2e567
commit 683bb5a88d
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 public function find($id): ?Tenant
{ {
return $this->model()->find($id); return $this->model()->where($this->model()->getTenantKeyName(), $id)->first();
} }
/** /**