whereNotNull('bank_integration_yodlee_account_id')->cursor()->each(function ($account) { // $queue = Ninja::isHosted() ? 'bank' : 'default'; if ($account->isPaid() && $account->plan == 'enterprise') { $account->bank_integrations()->where('integration_type', BankIntegration::INTEGRATION_TYPE_YODLEE)->andWhere('auto_sync', true)->cursor()->each(function ($bank_integration) use ($account) { (new ProcessBankTransactionsYodlee($account, $bank_integration))->handle(); }); } }); nlog("syncing transactions - nordigen"); $b = Account::with('bank_integrations')->whereNotNull('bank_integration_nordigen_secret_id')->andWhereNotNull('bank_integration_nordigen_secret_key')->cursor()->each(function ($account) { $account->bank_integrations()->where('integration_type', BankIntegration::INTEGRATION_TYPE_NORDIGEN)->andWhere('auto_sync', true)->cursor()->each(function ($bank_integration) use ($account) { (new ProcessBankTransactionsNordigen($account, $bank_integration))->handle(); }); }); nlog("syncing transactions - done"); } } }