whereNotNull('bank_integration_account_id')->cursor()->each(function ($account) { if ($account->isPaid() && $account->plan == 'enterprise') { $account->bank_integrations()->where('integration_type', BankIntegration::INTEGRATION_TYPE_YODLEE)->where('auto_sync', true)->where('is_deleted', false)->cursor()->each(function ($bank_integration) use ($account) { (new ProcessBankTransactionsYodlee($account, $bank_integration))->handle(); }); } }); } if (config("ninja.nordigen.secret_id") && config("ninja.nordigen.secret_key")) { // @turbo124 check condition, when to execute this should be placed here (isSelfHosted || isPro/isEnterprise) nlog("syncing transactions - nordigen"); Account::with('bank_integrations')->cursor()->each(function ($account) { if ((Ninja::isSelfHost() || (Ninja::isHosted() && $account->isPaid() && $account->plan == 'enterprise'))) { $account->bank_integrations()->where('integration_type', BankIntegration::INTEGRATION_TYPE_NORDIGEN)->where('auto_sync', true)->where('is_deleted', false)->cursor()->each(function ($bank_integration) { (new ProcessBankTransactionsNordigen($bank_integration))->handle(); }); } }); } nlog("syncing transactions - done"); } } }