From: Vincent Vanwaelscappel Date: Tue, 16 Jul 2024 16:54:53 +0000 (+0200) Subject: wait #6297 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=20efc9b3ce94202ace8002886d5ca7977fc31077;p=fluidbook-toolbox.git wait #6297 --- diff --git a/app/Models/TeamEmails.php b/app/Models/TeamEmails.php index f62e6317f..bab2c1aad 100644 --- a/app/Models/TeamEmails.php +++ b/app/Models/TeamEmails.php @@ -202,8 +202,19 @@ class TeamEmails extends CubistMagicAbstractModel $freeproviders = \Illuminate\Support\Facades\Cache::rememberForever('freeemailproviders', function () { return Text::splitLines(file_get_contents('https://gist.githubusercontent.com/drakodev/e85c1fd6d9ac8634786d6139e0066fa0/raw/1f345fa275fafda8196af754674fcf04d05b7fba/free-disposable-email-providers.txt')); }); + + + $emails = []; + foreach (Company::withoutGlobalScopes()->where('created_ok', '1')->get() as $company) { + $emails = array_merge($emails, $company->getEmails()); + } + foreach (User::withoutGlobalScopes()->where('created_ok', '1')->where('enabled', '1')->get() as $user) { - $email = trim(mb_strtolower($user->email)); + $emails = array_merge($emails, $user->getEmails()); + } + + + foreach ($emails as $email) { $e = explode('@', $email); if (count($e) < 2) { continue; @@ -218,6 +229,7 @@ class TeamEmails extends CubistMagicAbstractModel $res = array_unique($res); sort($res); + dd($res); return $res; } }