[ $this->mergeWhen($this->currency !== null, [ 'currency' => $this->currency->iso, ]), $this->mergeWhen($this->invited_by_user_id !== null, function () { try { $invited_by_user = Contact::where('account_id', $this->account_id) ->findOrFail($this->invited_by_user_id); return [ 'invited_by_user' => $invited_by_user->uuid, ]; } catch (\Exception $e) { return new MissingValue(); } }), $this->mergeWhen($this->me !== null, function () { return ['me_contact' => $this->me->uuid]; }), ], ]; } }