1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-06 08:04:03 +00:00

CanFindByAnyKey interface

This commit is contained in:
Samuel Štancl 2019-10-27 12:20:40 +01:00
parent 081799e233
commit d61117c3b6
5 changed files with 28 additions and 7 deletions

View file

@ -77,11 +77,11 @@ class DatabaseStorageDriver implements StorageDriver, CanDeleteKeys
* @param string $key
* @param mixed $value
* @return Tenant
* @throws TenantCouldNotBeIdentifiedException // todo ?
* @throws TenantDoesNotExistException
*/
public function findBy(string $key, $value): Tenant
{
// [WIP] [TODO] Temporary implementation, key has to be a custom column.
// The key has to be a custom column. It's recommended to set up an index
$tenant = Tenants::where($key, $value)->first();
if (! $tenant) {