title: failed to open stream: No such file or directory at /var/www/html/fisecal-backend/vendor/composer/ClassLoader.php:444)
body: <p>I have a class app/Helpers/CommonHelper.php and I use this in controller like
  <code>use App\Helpers\CommonHelper;</code> and i called a static function of this class <code>CommonHelper::addAccounts();</code> but the problem is it is giving me an error of</p>
  
  <blockquote>
    <p>include(/var/www/html/fisecal-backend/vendor/composer/../../app/Helpers/CommonHelper_bck.php):
    failed to open stream: No such file or directory</p>
  </blockquote>
  
  <p>I tried to remove cache by using command '<code>php artisan optimize:clear</code>'.
  please help me to find what i missed.</p>
  
  <p>CommonHelper.php</p>
  
  <pre><code>&lt;?php
  namespace App\Helpers;
  
  use App\Models\UserInstituteAccounts;
  use App\Models\UserTransactions;
  
  class CommonHelper
  {
      public static function addAccounts($account) {
          $UserInstituteAccounts = UserInstituteAccounts::where(['account_id' =&gt; $account['id']])-&gt;first();
          if (empty($UserInstituteAccounts)) {
              $UserInstituteAccounts = new UserInstituteAccounts();
              $UserInstituteAccounts-&gt;account_id = $account['id'];
          }
          if (isset($account['number']))
              $UserInstituteAccounts-&gt;number = $account['number'];
          if (isset($account['name']))
              $UserInstituteAccounts-&gt;name = $account['name'];
          if (isset($account['balance']))
              $UserInstituteAccounts-&gt;balance = $account['balance'];
          if (isset($account['type']))
              $UserInstituteAccounts-&gt;type = $account['type'];
          if (isset($account['status']))
              $UserInstituteAccounts-&gt;status = $account['status'];
          if (isset($account['customerId']))
              $UserInstituteAccounts-&gt;customerId = $account['customerId'];
          if (isset($account['institutionId']))
              $UserInstituteAccounts-&gt;institutionId = $account['institutionId'];
          if (isset($account['createdDate']))
              $UserInstituteAccounts-&gt;createdDate = date('Y-m-d H:i:s', $account['createdDate']);
          if (isset($account['aggregationSuccessDate']))
              $UserInstituteAccounts-&gt;aggregationSuccessDate = date('Y-m-d H:i:s', $account['aggregationSuccessDate']);
          if (isset($account['aggregationAttemptDate']))
              $UserInstituteAccounts-&gt;aggregationAttemptDate = date('Y-m-d H:i:s', $account['aggregationAttemptDate']);
          if (isset($account['lastTransactionDate']))
              $UserInstituteAccounts-&gt;lastTransactionDate = date('Y-m-d H:i:s', $account['lastTransactionDate']);
          if (isset($account['currency']))
              $UserInstituteAccounts-&gt;currency = $account['currency'];
          if (isset($account['institutionLoginId']))
              $UserInstituteAccounts-&gt;institutionLoginId = $account['institutionLoginId'];
          if (isset($account['displayPosition']))
              $UserInstituteAccounts-&gt;displayPosition = $account['displayPosition'];
  
          if(!empty($account['lastUpdatedDate'])){
              $UserInstituteAccounts-&gt;lastUpdatedDate = date('Y-m-d H:i:s', $account['lastUpdatedDate']);
          }
  
          if(!empty($account['detail'])){
              $detail = $account['detail'];
  
              if(!empty($detail['postedDate'])){
                  $UserInstituteAccounts-&gt;postedDate = date('Y-m-d H:i:s', $detail['postedDate']);
              }
  
              if(!empty($detail['availableBalanceAmount'])){
                  $UserInstituteAccounts-&gt;availableBalanceAmount = $detail['availableBalanceAmount'];
              }
  
              if(!empty($detail['openDate '])){
                  $UserInstituteAccounts-&gt;openDate = date('Y-m-d H:i:s', $detail['openDate']);
              }
  
              if(!empty($detail['periodStartDate'])){
                  $UserInstituteAccounts-&gt;periodStartDate = date('Y-m-d H:i:s', $detail['periodStartDate']);
              }
  
              if(!empty($detail['periodEndDate'])){
                  $UserInstituteAccounts-&gt;periodEndDate = date('Y-m-d H:i:s', $detail['periodEndDate']);
              }
  
              if(!empty($detail['periodInterestRate'])){
                  $UserInstituteAccounts-&gt;periodInterestRate = $detail['periodInterestRate'];
              }
  
              if(!empty($detail['periodDepositAmount'])){
                  $UserInstituteAccounts-&gt;periodDepositAmount = $detail['periodDepositAmount'];
              }
  
              if(!empty($detail['periodInterestAmount'])){
                  $UserInstituteAccounts-&gt;periodInterestAmount = $detail['periodInterestAmount'];
              }
  
              if(!empty($detail['interestYtdAmount'])){
                  $UserInstituteAccounts-&gt;interestYtdAmount = $detail['interestYtdAmount'];
              }
  
              if(!empty($detail['interestPriorYtdAmount'])){
                  $UserInstituteAccounts-&gt;interestPriorYtdAmount = $detail['interestPriorYtdAmount'];
              }
  
              if(!empty($detail['maturityDate'])){
                  $UserInstituteAccounts-&gt;maturityDate = date('Y-m-d H:i:s', $detail['maturityDate']);
              }
  
              if(!empty($detail['interestRate'])){
                  $UserInstituteAccounts-&gt;interestRate = $detail['interestRate'];
              }
  
              if(!empty($detail['creditAvailableAmount'])){
                  $UserInstituteAccounts-&gt;creditAvailableAmount = $detail['creditAvailableAmount'];
              }
  
              if(!empty($detail['creditMaxAmount'])){
                  $UserInstituteAccounts-&gt;creditMaxAmount = $detail['creditMaxAmount'];
              }
  
              if(!empty($detail['cashAdvanceAvailableAmount'])){
                  $UserInstituteAccounts-&gt;cashAdvanceAvailableAmount = $detail['cashAdvanceAvailableAmount'];
              }
  
              if(!empty($detail['cashAdvanceMaxAmount'])){
                  $UserInstituteAccounts-&gt;cashAdvanceMaxAmount = $detail['cashAdvanceMaxAmount'];
              }
  
              if(!empty($detail['cashAdvanceBalance'])){
                  $UserInstituteAccounts-&gt;cashAdvanceBalance = $detail['cashAdvanceBalance'];
              }
  
              if(!empty($detail['cashAdvanceInterestRate'])){
                  $UserInstituteAccounts-&gt;cashAdvanceInterestRate = $detail['cashAdvanceInterestRate'];
              }
  
              if(!empty($detail['currentBalance'])){
                  $UserInstituteAccounts-&gt;currentBalance = $detail['currentBalance'];
              }
  
              if(!empty($detail['paymentMinAmount'])){
                  $UserInstituteAccounts-&gt;paymentMinAmount = $detail['paymentMinAmount'];
              }
  
              if(!empty($detail['paymentDueDate'])){
                  $UserInstituteAccounts-&gt;paymentDueDate = date('Y-m-d H:i:s', $detail['paymentDueDate']);
              }
  
              if(!empty($detail['previousBalance'])){
                  $UserInstituteAccounts-&gt;previousBalance = $detail['previousBalance'];
              }
  
              if(!empty($detail['statementStartDate'])){
                  $UserInstituteAccounts-&gt;statementStartDate = date('Y-m-d H:i:s', $detail['statementStartDate']);
              }
  
              if(!empty($detail['statementEndDate'])){
                  $UserInstituteAccounts-&gt;statementEndDate = date('Y-m-d H:i:s', $detail['statementEndDate']);
              }
  
              if(!empty($detail['statementPurchaseAmount'])){
                  $UserInstituteAccounts-&gt;statementPurchaseAmount = $detail['statementPurchaseAmount'];
              }
  
              if(!empty($detail['statementCreditAmount'])){
                  $UserInstituteAccounts-&gt;statementCreditAmount = $detail['statementCreditAmount'];
              }
  
              if(!empty($detail['rewardEarnedBalance'])){
                  $UserInstituteAccounts-&gt;rewardEarnedBalance = $detail['rewardEarnedBalance'];
              }
  
              if(!empty($detail['pastDueAmount'])){
                  $UserInstituteAccounts-&gt;pastDueAmount = $detail['pastDueAmount'];
              }
  
              if(!empty($detail['lastPaymentAmount'])){
                  $UserInstituteAccounts-&gt;lastPaymentAmount = $detail['lastPaymentAmount'];
              }
  
              if(!empty($detail['lastPaymentDate'])){
                  $UserInstituteAccounts-&gt;lastPaymentDate = date('Y-m-d H:i:s', $detail['lastPaymentDate']);
              }
  
              if(!empty($detail['statementCloseBalance'])){
                  $UserInstituteAccounts-&gt;statementCloseBalance = $detail['statementCloseBalance'];
              }
  
              if(!empty($detail['interestMarginBalance'])){
                  $UserInstituteAccounts-&gt;interestMarginBalance = $detail['interestMarginBalance'];
              }
  
              if(!empty($detail['shortBalance'])){
                  $UserInstituteAccounts-&gt;shortBalance = $detail['shortBalance'];
              }
  
              if(!empty($detail['availableCashBalance'])){
                  $UserInstituteAccounts-&gt;availableCashBalance = $detail['availableCashBalance'];
              }
  
              if(!empty($detail['maturityValueAmount'])){
                  $UserInstituteAccounts-&gt;maturityValueAmount = $detail['maturityValueAmount'];
              }
  
              if(!empty($detail['vestedBalance'])){
                  $UserInstituteAccounts-&gt;vestedBalance = $detail['vestedBalance'];
              }
  
              if(!empty($detail['empMatchAmount'])){
                  $UserInstituteAccounts-&gt;empMatchAmount = $detail['empMatchAmount'];
              }
  
              if(!empty($detail['empPretaxContribAmount'])){
                  $UserInstituteAccounts-&gt;empPretaxContribAmount = $detail['empPretaxContribAmount'];
              }
  
              if(!empty($detail['empPretaxContribAmountYtd'])){
                  $UserInstituteAccounts-&gt;empPretaxContribAmountYtd = $detail['empPretaxContribAmountYtd'];
              }
  
              if(!empty($detail['contribTotalYtd'])){
                  $UserInstituteAccounts-&gt;contribTotalYtd = $detail['contribTotalYtd'];
              }
  
              if(!empty($detail['cashBalanceAmount'])){
                  $UserInstituteAccounts-&gt;cashBalanceAmount = $detail['cashBalanceAmount'];
              }
  
              if(!empty($detail['preTaxAmount'])){
                  $UserInstituteAccounts-&gt;preTaxAmount = $detail['preTaxAmount'];
              }
  
              if(!empty($detail['afterTaxAmount'])){
                  $UserInstituteAccounts-&gt;afterTaxAmount = $detail['afterTaxAmount'];
              }
  
              if(!empty($detail['matchAmount'])){
                  $UserInstituteAccounts-&gt;matchAmount = $detail['matchAmount'];
              }
  
              if(!empty($detail['profitSharingAmount'])){
                  $UserInstituteAccounts-&gt;profitSharingAmount = $detail['profitSharingAmount'];
              }
  
              if(!empty($detail['rolloverAmount'])){
                  $UserInstituteAccounts-&gt;rolloverAmount = $detail['rolloverAmount'];
              }
  
              if(!empty($detail['otherVestAmount'])){
                  $UserInstituteAccounts-&gt;otherVestAmount = $detail['otherVestAmount'];
              }
  
              if(!empty($detail['otherNonvestAmount'])){
                  $UserInstituteAccounts-&gt;otherNonvestAmount = $detail['otherNonvestAmount'];
              }
  
              if(!empty($detail['currentLoanBalance'])){
                  $UserInstituteAccounts-&gt;currentLoanBalance = $detail['currentLoanBalance'];
              }
  
              if(!empty($detail['loanRate'])){
                  $UserInstituteAccounts-&gt;loanRate = $detail['loanRate'];
              }
  
              if(!empty($detail['buyPower'])){
                  $UserInstituteAccounts-&gt;buyPower = $detail['buyPower'];
              }
  
              if(!empty($detail['rolloverLtd'])){
                  $UserInstituteAccounts-&gt;rolloverLtd = $detail['rolloverLtd'];
              }
  
              if(!empty($detail['termOfMl'])){
                  $UserInstituteAccounts-&gt;termOfMl = $detail['termOfMl'];
              }
  
              if(!empty($detail['mlHolderName'])){
                  $UserInstituteAccounts-&gt;mlHolderName = $detail['mlHolderName'];
              }
  
              if(!empty($detail['description'])){
                  $UserInstituteAccounts-&gt;description = $detail['description'];
              }
  
              if(!empty($detail['lateFeeAmount'])){
                  $UserInstituteAccounts-&gt;lateFeeAmount = $detail['lateFeeAmount'];
              }
  
              if(!empty($detail['payoffAmount'])){
                  $UserInstituteAccounts-&gt;payoffAmount = $detail['payoffAmount'];
              }
  
              if(!empty($detail['payoffAmountDate'])){
                  $UserInstituteAccounts-&gt;payoffAmountDate = date('Y-m-d H:i:s', $detail['payoffAmountDate']);
              }
  
              if(!empty($detail['originalMaturityDate'])){
                  $UserInstituteAccounts-&gt;originalMaturityDate = date('Y-m-d H:i:s', $detail['originalMaturityDate']);
              }
  
              if(!empty($detail['principalBalance'])){
                  $UserInstituteAccounts-&gt;principalBalance = $detail['principalBalance'];
              }
  
              if(!empty($detail['escrowBalance'])){
                  $UserInstituteAccounts-&gt;escrowBalance = $detail['escrowBalance'];
              }
  
              if(!empty($detail['interestPeriod'])){
                  $UserInstituteAccounts-&gt;interestPeriod = $detail['interestPeriod'];
              }
  
              if(!empty($detail['initialMlAmount'])){
                  $UserInstituteAccounts-&gt;initialMlAmount = $detail['initialMlAmount'];
              }
  
              if(!empty($detail['initialMlDate'])){
                  $UserInstituteAccounts-&gt;initialMlDate = date('Y-m-d H:i:s', $detail['initialMlDate']);
              }
  
              if(!empty($detail['nextPaymentPrincipalAmount'])){
                  $UserInstituteAccounts-&gt;nextPaymentPrincipalAmount = $detail['nextPaymentPrincipalAmount'];
              }
  
              if(!empty($detail['nextPaymentInterestAmount'])){
                  $UserInstituteAccounts-&gt;nextPaymentInterestAmount = $detail['nextPaymentInterestAmount'];
              }
  
              if(!empty($detail['nextPayment'])){
                  $UserInstituteAccounts-&gt;nextPayment = $detail['nextPayment'];
              }
  
              if(!empty($detail['nextPaymentDate'])){
                  $UserInstituteAccounts-&gt;nextPaymentDate = date('Y-m-d H:i:s', $detail['nextPaymentDate']);
              }
  
              if(!empty($detail['lastPaymentDueDate'])){
                  $UserInstituteAccounts-&gt;lastPaymentDueDate = date('Y-m-d H:i:s', $detail['lastPaymentDueDate']);
              }
  
              if(!empty($detail['lastPaymentReceiveDate'])){
                  $UserInstituteAccounts-&gt;lastPaymentReceiveDate = date('Y-m-d H:i:s', $detail['lastPaymentReceiveDate']);
              }
  
              if(!empty($detail['lastPaymentPrincipalAmount'])){
                  $UserInstituteAccounts-&gt;lastPaymentPrincipalAmount = $detail['lastPaymentPrincipalAmount'];
              }
  
              if(!empty($detail['lastPaymentInterestAmount'])){
                  $UserInstituteAccounts-&gt;lastPaymentInterestAmount = $detail['lastPaymentInterestAmount'];
              }
  
              if(!empty($detail['lastPaymentEscrowAmount'])){
                  $UserInstituteAccounts-&gt;lastPaymentEscrowAmount = $detail['lastPaymentEscrowAmount'];
              }
  
              if(!empty($detail['lastPaymentLastFeeAmount'])){
                  $UserInstituteAccounts-&gt;lastPaymentLastFeeAmount = $detail['lastPaymentLastFeeAmount'];
              }
  
              if(!empty($detail['lastPaymentLateCharge'])){
                  $UserInstituteAccounts-&gt;lastPaymentLateCharge = $detail['lastPaymentLateCharge'];
              }
  
              if(!empty($detail['ytdPrincipalPaid'])){
                  $UserInstituteAccounts-&gt;ytdPrincipalPaid = $detail['ytdPrincipalPaid'];
              }
  
              if(!empty($detail['ytdInterestPaid'])){
                  $UserInstituteAccounts-&gt;ytdInterestPaid = $detail['ytdInterestPaid'];
              }
  
              if(!empty($detail['ytdInsurancePaid'])){
                  $UserInstituteAccounts-&gt;ytdInsurancePaid = $detail['ytdInsurancePaid'];
              }
  
              if(!empty($detail['ytdTaxPaid'])){
                  $UserInstituteAccounts-&gt;ytdTaxPaid = $detail['ytdTaxPaid'];
              }
  
              if(!empty($detail['autoPayEnrolled'])){
                  $UserInstituteAccounts-&gt;autoPayEnrolled = $detail['autoPayEnrolled'];
              }
  
              if(!empty($detail['collateral'])){
                  $UserInstituteAccounts-&gt;collateral = $detail['collateral'];
              }
  
              if(!empty($detail['currentSchool'])){
                  $UserInstituteAccounts-&gt;currentSchool = $detail['currentSchool'];
              }
  
              if(!empty($detail['firstPaymentDate'])){
                  $UserInstituteAccounts-&gt;firstPaymentDate = date('Y-m-d H:i:s', $detail['firstPaymentDate']);
              }
  
              if(!empty($detail['firstMortgage'])){
                  $UserInstituteAccounts-&gt;firstMortgage = $detail['firstMortgage'];
              }
  
              if(!empty($detail['loanPaymentFreq'])){
                  $UserInstituteAccounts-&gt;loanPaymentFreq = $detail['loanPaymentFreq'];
              }
  
              if(!empty($detail['originalSchool'])){
                  $UserInstituteAccounts-&gt;originalSchool = $detail['originalSchool'];
              }
  
              if(!empty($detail['recurringPaymentAmount'])){
                  $UserInstituteAccounts-&gt;recurringPaymentAmount = $detail['recurringPaymentAmount'];
              }
  
              if(!empty($detail['lender'])){
                  $UserInstituteAccounts-&gt;lender = $detail['lender'];
              }
  
              if(!empty($detail['endingBalanceAmount'])){
                  $UserInstituteAccounts-&gt;endingBalanceAmount = $detail['endingBalanceAmount'];
              }
  
              if(!empty($detail['paymentsRemaining'])){
                  $UserInstituteAccounts-&gt;paymentsRemaining = $detail['paymentsRemaining'];
              }
  
              if(!empty($detail['loanTermType'])){
                  $UserInstituteAccounts-&gt;loanTermType = $detail['loanTermType'];
              }
  
              if(!empty($detail['paymentsMade'])){
                  $UserInstituteAccounts-&gt;paymentsMade = $detail['paymentsMade'];
              }
  
              if(!empty($detail['balloonAmount'])){
                  $UserInstituteAccounts-&gt;balloonAmount = $detail['balloonAmount'];
              }
  
              if(!empty($detail['projectedInterest'])){
                  $UserInstituteAccounts-&gt;projectedInterest = $detail['projectedInterest'];
              }
  
              if(!empty($detail['interestPaidLtd'])){
                  $UserInstituteAccounts-&gt;interestPaidLtd = $detail['interestPaidLtd'];
              }
  
              if(!empty($detail['interestRateType'])){
                  $UserInstituteAccounts-&gt;interestRateType = $detail['interestRateType'];
              }
  
              if(!empty($detail['loanPaymentType'])){
                  $UserInstituteAccounts-&gt;loanPaymentType = $detail['loanPaymentType'];
              }
  
          }
  
          $UserInstituteAccounts-&gt;save();
  
          return true;
      }
  
  
  }
  </code></pre>
  
  <p>Controller file</p>
  
  <pre><code>&lt;?php
  namespace App\Http\Controllers\Cron;
  
  use Illuminate\Http\Request;
  use App\Http\Controllers\Controller;
  
  use App\Repositories\FinicityRepository;
  use App\Models\UserInstitutes;
  use App\Models\UserInstituteAccounts;
  use App\Models\UserTransactions;
  use App\Models\AppSettings;
  use App\Helpers\CommonHelper;
  
  
  class TransactionsController extends Controller {
      public function index() {
          $customerId = 5;
          $account =  FinicityRepository::getCustomerAccounts($customerId);
          CommonHelper::addAccounts($account);
      }
  }
  </code></pre>