Add HR resource labels and helper methods for various resources; update locale handling in user model and department factory
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Filament\Resources\ActivityLogs;
|
||||
|
||||
use App\Enums\NavigationGroup;
|
||||
use App\Filament\Concerns\HasHrResourceLabels;
|
||||
use App\Filament\Resources\ActivityLogs\Pages\ListActivityLogs;
|
||||
use App\Filament\Resources\ActivityLogs\Pages\ViewActivityLog;
|
||||
use App\Filament\Resources\ActivityLogs\Schemas\ActivityLogInfolist;
|
||||
@@ -19,8 +20,19 @@ use UnitEnum;
|
||||
|
||||
class ActivityLogResource extends Resource
|
||||
{
|
||||
use HasHrResourceLabels;
|
||||
|
||||
protected static ?string $model = Activity::class;
|
||||
|
||||
protected static function hrLabelKeys(): array
|
||||
{
|
||||
return [
|
||||
'model' => 'activity_log',
|
||||
'plural' => 'activity_logs',
|
||||
'navigation' => 'audit_log',
|
||||
];
|
||||
}
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedClipboardDocumentList;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = NavigationGroup::System;
|
||||
@@ -29,21 +41,6 @@ class ActivityLogResource extends Resource
|
||||
|
||||
protected static ?string $slug = 'activity-logs';
|
||||
|
||||
public static function getNavigationLabel(): string
|
||||
{
|
||||
return __('hr.resources.audit_log');
|
||||
}
|
||||
|
||||
public static function getModelLabel(): string
|
||||
{
|
||||
return __('hr.resources.activity_log');
|
||||
}
|
||||
|
||||
public static function getPluralModelLabel(): string
|
||||
{
|
||||
return __('hr.resources.activity_logs');
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema;
|
||||
|
||||
Reference in New Issue
Block a user