31 lines
702 B
PHP
31 lines
702 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Concerns;
|
|
|
|
trait HasHrResourceLabels
|
|
{
|
|
/**
|
|
* @return array{model: string, plural: string, navigation?: string}
|
|
*/
|
|
abstract protected static function hrLabelKeys(): array;
|
|
|
|
public static function getModelLabel(): string
|
|
{
|
|
return __('hr.resources.'.static::hrLabelKeys()['model']);
|
|
}
|
|
|
|
public static function getPluralModelLabel(): string
|
|
{
|
|
return __('hr.resources.'.static::hrLabelKeys()['plural']);
|
|
}
|
|
|
|
public static function getNavigationLabel(): string
|
|
{
|
|
$keys = static::hrLabelKeys();
|
|
|
|
return __('hr.resources.'.($keys['navigation'] ?? $keys['plural']));
|
|
}
|
|
}
|