<?php

namespace App\Concerns;

trait HasLabels
{
    abstract protected function translationKey(): string;

    public function label(?string $locale = null): string
    {
        return __($this->translationKey(), locale: $locale ?? app()->getLocale());
    }
}
