account, $this->serializer); return $this->includeItem($payment->invoice, $transformer, 'invoice'); } public function includeClient(Payment $payment) { $transformer = new ClientTransformer($this->account, $this->serializer); return $this->includeItem($payment->client, $transformer, 'client'); } public function transform(Payment $payment) { return [ 'id' => (int) $payment->public_id, 'amount' => (float) $payment->amount, 'account_key' => $this->account->account_key, 'user_id' => (int) $payment->user->public_id + 1, 'transaction_reference' => $payment->transaction_reference, ]; } }