/** * Get account by id and set the balance field to the collection * @param $accountId * * @return Account */ public static function getFullInfoAboutAccount($accountId) { /* @var $account Account */ $account = Account::findOrFail($accountId); $account->balance = AccountsHistoryContainer::getAccountBalance($accountId); $account->currentMonthIncome = AccountsHistoryContainer::getIncomeForCurrentMonth($accountId); return $account; }