Skip to content

Commit

Permalink
Use the Tenant models' getTenantKeyName() value (archtechx#461)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
timothydc authored Jul 14, 2020
1 parent aee2a2e commit 683bb5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tenancy.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function model()

public function find($id): ?Tenant
{
return $this->model()->find($id);
return $this->model()->where($this->model()->getTenantKeyName(), $id)->first();
}

/**
Expand Down

0 comments on commit 683bb5a

Please sign in to comment.