*/ public function toArray(): array { return [ 'id' => $this->id, 'firstName' => $this->firstName, 'lastName' => $this->lastName, 'street' => $this->street, 'city' => $this->city, 'state' => $this->state, 'pinCode' => $this->pinCode, ]; } public static function fromModel(Address $address): OutputDataTransferObject { return new self( id: $address->id, firstName: $address->first_name, lastName: $address->last_name, street: $address->street, city: $address->city, state: $address->state, pinCode: $address->pin ); } }