mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Test for truth
This commit is contained in:
parent
fa602ef0cd
commit
9d8ee8a44e
@ -253,10 +253,13 @@ class MultiDB
|
||||
|
||||
public static function findAndSetDbByDomain($subdomain) :bool
|
||||
{
|
||||
|
||||
if (! config('ninja.db.multi_db_enabled'))
|
||||
return (Company::on($db)->whereSubdomain($subdomain)->exists() === true);
|
||||
|
||||
foreach (self::$dbs as $db) {
|
||||
if ($company = Company::on($db)->whereSubdomain($subdomain)->first()) {
|
||||
self::setDb($company->db);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user