From 057619b15730beb9a144f1b16e835166eeae27e2 Mon Sep 17 00:00:00 2001 From: Dennis Enderink Date: Sat, 27 Oct 2018 23:26:04 +0200 Subject: [PATCH] Cast to string because trans() could return array --- app/Services/Internal/Support/AccountServiceTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php index c87f879934..d58661fda4 100644 --- a/app/Services/Internal/Support/AccountServiceTrait.php +++ b/app/Services/Internal/Support/AccountServiceTrait.php @@ -217,12 +217,12 @@ trait AccountServiceTrait */ public function storeOpposingAccount(User $user, string $name): Account { - $opposingAccountName = trans('firefly.initial_balance_account', ['name' => $name]); + $opposingAccountName = (string)trans('firefly.initial_balance_account', ['name' => $name]); Log::debug('Going to create an opening balance opposing account.'); /** @var AccountFactory $factory */ $factory = app(AccountFactory::class); $factory->setUser($user); - + return $factory->findOrCreate($opposingAccountName, AccountType::INITIAL_BALANCE); }