I am getting the product inventory source successfully below is my code.
$sources = $this->getSourceItemsBySku->execute($sku);
$array = [];
foreach ($sources as $index => $source) {
$array[] = [
'value' => $source->getSourceCode(),
'label' => $source->getName()
];
}
Here you can see in an array I am getting value and label like this its showing be value but Label values in null $source->getName()
so how I can get source name.