getLabel(); if (str_ends_with($label, ' id')) { $label = str_replace(' id', '', $label); } $label = ucwords($label); } $this->label(translate($label)); return $this; }); Column::macro('localizeLabel', function (string | Htmlable | Closure | null $customLabel = null): static { if (filled($customLabel)) { $label = $customLabel; } else { $label = $this->getLabel(); if (str_ends_with($label, ' id')) { $label = str_replace(' id', '', $label); } $label = ucwords($label); } $this->label(translate($label)); return $this; }); NavigationGroup::macro('localizeLabel', function () { $label = $this->getLabel(); if ($label !== 'HR' && filled($label)) { $this->label(translate($label)); } return $this; }); Tab::macro('localizeLabel', function () { $label = $this->getLabel(); $this->label(ucfirst(translate($label))); return $this; }); } }