getDefaults($document), [ 'id' => (int) $document->public_id, 'name' => $document->name, 'type' => $document->type, 'path' => $document->path, 'invoice_id' => $document->invoice_id && $document->invoice ? (int) $document->invoice->public_id : null, 'expense_id' => $document->expense_id && $document->expense ? (int) $document->expense->public_id : null, 'updated_at' => $this->getTimestamp($document->updated_at), ]); } }