Add HR resource labels and helper methods for various resources; update locale handling in user model and department factory

This commit is contained in:
Mekan1206
2026-07-31 23:40:35 +05:00
parent 581cb8241c
commit 20d032c4cc
83 changed files with 4386 additions and 39 deletions

View File

@@ -0,0 +1,30 @@
<?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']));
}
}