Add HR resource labels and helper methods for various resources; update locale handling in user model and department factory
This commit is contained in:
1 parent
581cb8241c
commit
20d032c4cc
83 files changed
+4386
-39
No files matched your search
@@ -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']));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user