mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-06 08:04:03 +00:00
CanFindByAnyKey interface
This commit is contained in:
parent
081799e233
commit
d61117c3b6
5 changed files with 28 additions and 7 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue