get(); $segmentConstant = $segmentConstantObject->isEmpty() ? [] : (array)$segmentConstantObject->first()->value; return [ 'id' => $this->id, 'name' => $this->name, 'country' => $this->country, 'stateCharges' => array_key_exists($this->id, $segmentConstant) ? $segmentConstant[$this->id] : null, ]; } }