transaction; $accountStatement = $transaction->statement; return [ 'id' => $this->id, 'date' => Carbon::parse($transaction->posting_date)->format('Y-m-d'), 'transaction_description_1' => $transaction->transaction_description, 'transaction_description_2' => $transaction->transaction_description_2, 'transaction_description_3' => $transaction->transaction_description_3, 'transaction_description_4' => $transaction->transaction_description_4, 'transaction_description_5' => $transaction->transaction_description_5, 'pay_for' => $transaction->transaction_description_2, 'system_references' => $this->system, 'amount' => $transaction->amount, 'account_statement_date_from' => Carbon::parse($accountStatement->date_from)->format('Y-m-d'), 'account_statement_date_to' => Carbon::parse($accountStatement->date_to)->format('Y-m-d'), ]; } }