translate base

This commit is contained in:
Mekan1206 committed 2026-07-31 18:08:08 +05:00
1 parent a794dacd39
commit 581cb8241c
413 files changed
+9087 -428

No files matched your search

@@ -4,6 +4,7 @@
namespace App\Filament\Resources\ActivityLogs;
use App\Enums\NavigationGroup;
use App\Filament\Resources\ActivityLogs\Pages\ListActivityLogs;
use App\Filament\Resources\ActivityLogs\Pages\ViewActivityLog;
use App\Filament\Resources\ActivityLogs\Schemas\ActivityLogInfolist;
@@ -22,18 +23,27 @@ class ActivityLogResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedClipboardDocumentList;
protected static string|UnitEnum|null $navigationGroup = 'System';
protected static string|UnitEnum|null $navigationGroup = NavigationGroup::System;
protected static ?int $navigationSort = 3;
protected static ?string $navigationLabel = 'Audit Log';
protected static ?string $modelLabel = 'Activity Log';
protected static ?string $pluralModelLabel = 'Activity Logs';
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;
@@ -15,28 +15,28 @@ public static function configure(Schema $schema): Schema
{
return $schema
->components([
Section::make('Activity Details')
Section::make(__('hr.sections.activity_details'))
->schema([
TextEntry::make('created_at')
->label('Date')
->label(__('hr.fields.date'))
->dateTime(),
TextEntry::make('description'),
TextEntry::make('event')
->badge(),
TextEntry::make('log_name')
->label('Log Name'),
->label(__('hr.fields.log_name')),
TextEntry::make('subject_type')
->label('Subject Type')
->label(__('hr.fields.subject_type'))
->formatStateUsing(fn (?string $state): string => $state ? class_basename($state) : '—'),
TextEntry::make('subject_id')
->label('Subject ID'),
->label(__('hr.fields.subject_id')),
TextEntry::make('causer.name')
->label('Causer'),
->label(__('hr.fields.causer')),
KeyValueEntry::make('properties.attributes')
->label('Changes')
->label(__('hr.fields.changes'))
->visible(fn ($record): bool => filled($record->properties['attributes'] ?? null)),
KeyValueEntry::make('properties.old')
->label('Previous Values')
->label(__('hr.fields.previous_values'))
->visible(fn ($record): bool => filled($record->properties['old'] ?? null)),
])
->columns(2),
@@ -25,7 +25,7 @@ public static function configure(Table $table): Table
return $table
->columns([
TextColumn::make('created_at')
->label('Date')
->label(__('hr.fields.date'))
->dateTime()
->sortable(),
TextColumn::make('description')
@@ -36,15 +36,15 @@ public static function configure(Table $table): Table
->searchable()
->sortable(),
TextColumn::make('subject_type')
->label('Subject Type')
->label(__('hr.fields.subject_type'))
->formatStateUsing(fn (?string $state): string => $state ? class_basename($state) : '—')
->searchable()
->sortable(),
TextColumn::make('subject_id')
->label('Subject ID')
->label(__('hr.fields.subject_id'))
->sortable(),
TextColumn::make('causer.name')
->label('Causer')
->label(__('hr.fields.causer'))
->searchable()
->sortable(),
TextColumn::make('log_name')
@@ -53,14 +53,14 @@ public static function configure(Table $table): Table
->defaultSort('created_at', 'desc')
->filters([
SelectFilter::make('subject_type')
->label('Subject Type')
->label(__('hr.fields.subject_type'))
->options([
Employee::class => 'Employee',
Vacation::class => 'Vacation',
Bonus::class => 'Bonus',
DisciplinaryReport::class => 'Disciplinary Report',
Department::class => 'Department',
User::class => 'User',
Employee::class => __('hr.audit.employee'),
Vacation::class => __('hr.audit.vacation'),
Bonus::class => __('hr.audit.bonus'),
DisciplinaryReport::class => __('hr.audit.disciplinary_report'),
Department::class => __('hr.audit.department'),
User::class => __('hr.audit.user'),
]),
SelectFilter::make('event')
->options(fn (): array => \Spatie\Activitylog\Models\Activity::query()
@@ -69,16 +69,16 @@ public static function configure(Table $table): Table
->pluck('event', 'event')
->all()),
SelectFilter::make('causer')
->label('Causer')
->label(__('hr.fields.causer'))
->relationship('causer', 'name')
->searchable()
->preload(),
Filter::make('created_at')
->schema([
DatePicker::make('from')
->label('From'),
->label(__('hr.fields.from')),
DatePicker::make('until')
->label('Until'),
->label(__('hr.fields.until')),
])
->query(function (Builder $query, array $data): Builder {
return $query