translate base

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

View File

@@ -13,9 +13,9 @@ enum ApprovalStatus: string
public function label(): string public function label(): string
{ {
return match ($this) { return match ($this) {
self::Pending => 'Pending', self::Pending => __('enums.approval_status.pending'),
self::Approved => 'Approved', self::Approved => __('enums.approval_status.approved'),
self::Rejected => 'Rejected', self::Rejected => __('enums.approval_status.rejected'),
}; };
} }

View File

@@ -14,10 +14,10 @@ enum BonusType: string
public function label(): string public function label(): string
{ {
return match ($this) { return match ($this) {
self::Performance => 'Performance', self::Performance => __('enums.bonus_type.performance'),
self::Holiday => 'Holiday', self::Holiday => __('enums.bonus_type.holiday'),
self::Retention => 'Retention', self::Retention => __('enums.bonus_type.retention'),
self::Other => 'Other', self::Other => __('enums.bonus_type.other'),
}; };
} }

View File

@@ -13,9 +13,9 @@ enum DisciplinarySeverity: string
public function label(): string public function label(): string
{ {
return match ($this) { return match ($this) {
self::Low => 'Low', self::Low => __('enums.disciplinary_severity.low'),
self::Medium => 'Medium', self::Medium => __('enums.disciplinary_severity.medium'),
self::High => 'High', self::High => __('enums.disciplinary_severity.high'),
}; };
} }

View File

@@ -15,11 +15,11 @@ enum DocumentType: string
public function label(): string public function label(): string
{ {
return match ($this) { return match ($this) {
self::Passport => 'Passport', self::Passport => __('enums.document_type.passport'),
self::Contract => 'Contract', self::Contract => __('enums.document_type.contract'),
self::MedicalCertificate => 'Medical Certificate', self::MedicalCertificate => __('enums.document_type.medical_certificate'),
self::EducationCertificate => 'Education Certificate', self::EducationCertificate => __('enums.document_type.education_certificate'),
self::Other => 'Other', self::Other => __('enums.document_type.other'),
}; };
} }

View File

@@ -14,10 +14,10 @@ enum EmploymentStatus: string
public function label(): string public function label(): string
{ {
return match ($this) { return match ($this) {
self::Active => 'Active', self::Active => __('enums.employment_status.active'),
self::Inactive => 'Inactive', self::Inactive => __('enums.employment_status.inactive'),
self::Terminated => 'Terminated', self::Terminated => __('enums.employment_status.terminated'),
self::OnLeave => 'On Leave', self::OnLeave => __('enums.employment_status.on_leave'),
}; };
} }

View File

@@ -13,9 +13,9 @@ enum Gender: string
public function label(): string public function label(): string
{ {
return match ($this) { return match ($this) {
self::Male => 'Male', self::Male => __('enums.gender.male'),
self::Female => 'Female', self::Female => __('enums.gender.female'),
self::Other => 'Other', self::Other => __('enums.gender.other'),
}; };
} }

View File

@@ -14,10 +14,10 @@ enum ImportType: string
public function label(): string public function label(): string
{ {
return match ($this) { return match ($this) {
self::Employees => 'Employees', self::Employees => __('enums.import_type.employees'),
self::Vacations => 'Vacations', self::Vacations => __('enums.import_type.vacations'),
self::Bonuses => 'Bonuses', self::Bonuses => __('enums.import_type.bonuses'),
self::Reports => 'Disciplinary Reports', self::Reports => __('enums.import_type.reports'),
}; };
} }
@@ -28,43 +28,43 @@ enum ImportType: string
{ {
return match ($this) { return match ($this) {
self::Employees => [ self::Employees => [
'employee_number' => 'Employee Number', 'employee_number' => __('hr.fields.employee_number'),
'full_name' => 'Full Name', 'full_name' => __('hr.fields.full_name'),
'national_id' => 'National ID', 'national_id' => __('hr.fields.national_id'),
'gender' => 'Gender', 'gender' => __('hr.fields.gender'),
'birth_date' => 'Birth Date', 'birth_date' => __('hr.fields.birth_date'),
'phone' => 'Phone', 'phone' => __('hr.fields.phone'),
'address' => 'Address', 'address' => __('hr.fields.address'),
'department' => 'Department', 'department' => __('hr.fields.department'),
'position' => 'Position', 'position' => __('hr.fields.position'),
'shift' => 'Shift', 'shift' => __('hr.fields.shift'),
'employment_status' => 'Employment Status', 'employment_status' => __('hr.fields.employment_status'),
'hire_date' => 'Hire Date', 'hire_date' => __('hr.fields.hire_date'),
'notes' => 'Notes', 'notes' => __('hr.fields.notes'),
], ],
self::Vacations => [ self::Vacations => [
'employee_number' => 'Employee Number', 'employee_number' => __('hr.fields.employee_number'),
'type' => 'Type', 'type' => __('hr.fields.type'),
'start_date' => 'Start Date', 'start_date' => __('hr.fields.start_date'),
'end_date' => 'End Date', 'end_date' => __('hr.fields.end_date'),
'return_date' => 'Return Date', 'return_date' => __('hr.fields.return_date'),
'days' => 'Days', 'days' => __('hr.fields.days'),
'status' => 'Status', 'status' => __('hr.fields.status'),
'reason' => 'Reason', 'reason' => __('hr.fields.reason'),
], ],
self::Bonuses => [ self::Bonuses => [
'employee_number' => 'Employee Number', 'employee_number' => __('hr.fields.employee_number'),
'bonus_date' => 'Bonus Date', 'bonus_date' => __('hr.fields.bonus_date'),
'bonus_type' => 'Bonus Type', 'bonus_type' => __('hr.fields.bonus_type'),
'amount' => 'Amount', 'amount' => __('hr.fields.amount'),
'reason' => 'Reason', 'reason' => __('hr.fields.reason'),
], ],
self::Reports => [ self::Reports => [
'employee_number' => 'Employee Number', 'employee_number' => __('hr.fields.employee_number'),
'report_date' => 'Report Date', 'report_date' => __('hr.fields.report_date'),
'title' => 'Title', 'title' => __('hr.fields.title'),
'description' => 'Description', 'description' => __('hr.fields.description'),
'severity' => 'Severity', 'severity' => __('hr.fields.severity'),
], ],
}; };
} }

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace App\Enums;
use Filament\Support\Contracts\HasLabel;
enum NavigationGroup: string implements HasLabel
{
case Organization = 'organization';
case Employees = 'employees';
case LeaveManagement = 'leave_management';
case Records = 'records';
case System = 'system';
public function getLabel(): ?string
{
return __('hr.navigation.' . $this->value);
}
}

View File

@@ -14,10 +14,10 @@ enum VacationType: string
public function label(): string public function label(): string
{ {
return match ($this) { return match ($this) {
self::Annual => 'Annual', self::Annual => __('enums.vacation_type.annual'),
self::Marriage => 'Marriage', self::Marriage => __('enums.vacation_type.marriage'),
self::Study => 'Study', self::Study => __('enums.vacation_type.study'),
self::Other => 'Other', self::Other => __('enums.vacation_type.other'),
}; };
} }

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Filament\Pages; namespace App\Filament\Pages;
use App\Enums\ImportType; use App\Enums\ImportType;
use App\Enums\NavigationGroup;
use App\Jobs\ProcessImportJob; use App\Jobs\ProcessImportJob;
use App\Services\Import\ImportService; use App\Services\Import\ImportService;
use BackedEnum; use BackedEnum;
@@ -32,14 +33,10 @@ class ImportWizard extends Page
{ {
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedArrowUpTray; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedArrowUpTray;
protected static string|UnitEnum|null $navigationGroup = 'System'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::System;
protected static ?string $navigationLabel = 'Import Wizard';
protected static ?int $navigationSort = 2; protected static ?int $navigationSort = 2;
protected static ?string $title = 'Import Wizard';
protected static ?string $slug = 'import-wizard'; protected static ?string $slug = 'import-wizard';
/** /**
@@ -55,6 +52,16 @@ class ImportWizard extends Page
/** @var array<string, mixed>|null */ /** @var array<string, mixed>|null */
public ?array $importResult = null; public ?array $importResult = null;
public static function getNavigationLabel(): string
{
return __('hr.resources.import_wizard');
}
public function getTitle(): string|Htmlable
{
return __('hr.import.title');
}
public function mount(): void public function mount(): void
{ {
$this->form->fill([ $this->form->fill([
@@ -76,17 +83,17 @@ class ImportWizard extends Page
{ {
return $schema->components([ return $schema->components([
Wizard::make([ Wizard::make([
Step::make('Upload') Step::make(__('hr.import.upload'))
->description('Select import type and upload an Excel file') ->description(__('hr.import.upload_description'))
->schema([ ->schema([
Select::make('import_type') Select::make('import_type')
->label('Import Type') ->label(__('hr.import.import_type'))
->options(ImportType::class) ->options(ImportType::class)
->required() ->required()
->live() ->live()
->afterStateUpdated(fn () => $this->resetColumnMapping()), ->afterStateUpdated(fn () => $this->resetColumnMapping()),
FileUpload::make('file') FileUpload::make('file')
->label('Excel File') ->label(__('hr.import.excel_file'))
->disk(config('hr.file_uploads.disk')) ->disk(config('hr.file_uploads.disk'))
->directory(config('hr.file_uploads.directory') . '/imports') ->directory(config('hr.file_uploads.directory') . '/imports')
->acceptedFileTypes([ ->acceptedFileTypes([
@@ -97,29 +104,29 @@ class ImportWizard extends Page
->required() ->required()
->afterStateUpdated(fn () => $this->loadHeaders()), ->afterStateUpdated(fn () => $this->loadHeaders()),
]), ]),
Step::make('Map Columns') Step::make(__('hr.import.map_columns'))
->description('Match spreadsheet columns to system fields') ->description(__('hr.import.map_columns_description'))
->schema([ ->schema([
Section::make('Column Mapping') Section::make(__('hr.import.column_mapping'))
->schema(fn (): array => $this->getColumnMappingFields()), ->schema(fn (): array => $this->getColumnMappingFields()),
]), ]),
Step::make('Preview') Step::make(__('hr.import.preview_step'))
->description('Review the first 10 rows with validation') ->description(__('hr.import.preview_description'))
->schema([ ->schema([
Placeholder::make('preview_table') Placeholder::make('preview_table')
->label('Preview') ->label(__('hr.import.preview'))
->content(fn (): HtmlString => new HtmlString($this->getPreviewHtml())), ->content(fn (): HtmlString => new HtmlString($this->getPreviewHtml())),
]), ]),
Step::make('Import') Step::make(__('hr.import.import_step'))
->description('Run the import and review results') ->description(__('hr.import.import_description'))
->schema([ ->schema([
Placeholder::make('import_results') Placeholder::make('import_results')
->label('Import Results') ->label(__('hr.import.import_results'))
->content(fn (): HtmlString => new HtmlString($this->getResultsHtml())), ->content(fn (): HtmlString => new HtmlString($this->getResultsHtml())),
]), ]),
]) ])
->alpineSubmitHandler('$wire.runImport()') ->alpineSubmitHandler('$wire.runImport()')
->submitAction(new HtmlString('<button type="submit" class="fi-btn fi-btn-primary">Start Import</button>')) ->submitAction(new HtmlString('<button type="submit" class="fi-btn fi-btn-primary">' . e(__('hr.import.start_import')) . '</button>'))
->skippable(false), ->skippable(false),
]); ]);
} }
@@ -146,8 +153,8 @@ class ImportWizard extends Page
if ($filePath === null) { if ($filePath === null) {
Notification::make() Notification::make()
->title('Upload required') ->title(__('hr.import.upload_required_title'))
->body('Please upload an Excel file before importing.') ->body(__('hr.import.upload_required_body'))
->danger() ->danger()
->send(); ->send();
@@ -165,8 +172,8 @@ class ImportWizard extends Page
); );
Notification::make() Notification::make()
->title('Import queued') ->title(__('hr.import.import_queued_title'))
->body('Your import has been queued and will be processed shortly.') ->body(__('hr.import.import_queued_body'))
->success() ->success()
->send(); ->send();
} }
@@ -197,14 +204,14 @@ class ImportWizard extends Page
} }
/** /**
* @return array<int, Select> * @return array<int, Select|Placeholder>
*/ */
protected function getColumnMappingFields(): array protected function getColumnMappingFields(): array
{ {
if ($this->headers === []) { if ($this->headers === []) {
return [ return [
Placeholder::make('mapping_hint') Placeholder::make('mapping_hint')
->content('Upload a file in step 1 to load column headers.'), ->content(__('hr.import.mapping_hint')),
]; ];
} }
@@ -228,7 +235,7 @@ class ImportWizard extends Page
$path = $this->resolveStoredFilePath(); $path = $this->resolveStoredFilePath();
if ($path === null) { if ($path === null) {
return '<p class="text-sm text-gray-500">Upload a file to preview rows.</p>'; return '<p class="text-sm text-gray-500">' . e(__('hr.import.upload_to_preview')) . '</p>';
} }
$importType = ImportType::from($this->data['import_type'] ?? ImportType::Employees->value); $importType = ImportType::from($this->data['import_type'] ?? ImportType::Employees->value);
@@ -238,18 +245,18 @@ class ImportWizard extends Page
$validation = $importService->validatePreview($importType, $mappedRows); $validation = $importService->validatePreview($importType, $mappedRows);
if ($mappedRows === []) { if ($mappedRows === []) {
return '<p class="text-sm text-gray-500">No rows found in the uploaded file.</p>'; return '<p class="text-sm text-gray-500">' . e(__('hr.import.no_rows')) . '</p>';
} }
$fields = array_keys($importType->fields()); $fields = array_keys($importType->fields());
$html = '<div class="overflow-x-auto"><table class="fi-ta-table w-full text-sm"><thead><tr>'; $html = '<div class="overflow-x-auto"><table class="fi-ta-table w-full text-sm"><thead><tr>';
$html .= '<th class="px-3 py-2 text-left">Row</th>'; $html .= '<th class="px-3 py-2 text-left">' . e(__('hr.import.row')) . '</th>';
foreach ($fields as $field) { foreach ($fields as $field) {
$html .= '<th class="px-3 py-2 text-left">' . e($importType->fields()[$field]) . '</th>'; $html .= '<th class="px-3 py-2 text-left">' . e($importType->fields()[$field]) . '</th>';
} }
$html .= '<th class="px-3 py-2 text-left">Validation</th></tr></thead><tbody>'; $html .= '<th class="px-3 py-2 text-left">' . e(__('hr.import.validation')) . '</th></tr></thead><tbody>';
foreach ($mappedRows as $index => $row) { foreach ($mappedRows as $index => $row) {
$errors = $validation[$index]['errors'] ?? []; $errors = $validation[$index]['errors'] ?? [];
@@ -263,7 +270,7 @@ class ImportWizard extends Page
$html .= '<td class="px-3 py-2">'; $html .= '<td class="px-3 py-2">';
if ($errors === []) { if ($errors === []) {
$html .= '<span class="text-success-600">Valid</span>'; $html .= '<span class="text-success-600">' . e(__('hr.import.valid')) . '</span>';
} else { } else {
$html .= '<span class="text-danger-600">' . e(implode(' ', $errors)) . '</span>'; $html .= '<span class="text-danger-600">' . e(implode(' ', $errors)) . '</span>';
} }
@@ -281,17 +288,17 @@ class ImportWizard extends Page
$this->refreshImportResult(); $this->refreshImportResult();
if ($this->importResult === null) { if ($this->importResult === null) {
return '<p class="text-sm text-gray-500">Submit the import to see results here after processing completes.</p>'; return '<p class="text-sm text-gray-500">' . e(__('hr.import.submit_to_see_results')) . '</p>';
} }
$html = '<div class="space-y-2 text-sm">'; $html = '<div class="space-y-2 text-sm">';
$html .= '<p><strong>Total rows:</strong> ' . $this->importResult['total'] . '</p>'; $html .= '<p><strong>' . e(__('hr.import.total_rows')) . ':</strong> ' . $this->importResult['total'] . '</p>';
$html .= '<p><strong>Imported:</strong> ' . $this->importResult['imported'] . '</p>'; $html .= '<p><strong>' . e(__('hr.import.imported')) . ':</strong> ' . $this->importResult['imported'] . '</p>';
$html .= '<p><strong>Skipped (duplicates):</strong> ' . $this->importResult['skipped'] . '</p>'; $html .= '<p><strong>' . e(__('hr.import.skipped_duplicates')) . ':</strong> ' . $this->importResult['skipped'] . '</p>';
$html .= '<p><strong>Failed:</strong> ' . $this->importResult['failed'] . '</p>'; $html .= '<p><strong>' . e(__('hr.import.failed')) . ':</strong> ' . $this->importResult['failed'] . '</p>';
if (($this->importResult['errors'] ?? []) !== []) { if (($this->importResult['errors'] ?? []) !== []) {
$html .= '<div class="mt-3"><strong>Errors:</strong><ul class="list-disc ps-5">'; $html .= '<div class="mt-3"><strong>' . e(__('hr.import.errors')) . ':</strong><ul class="list-disc ps-5">';
foreach ($this->importResult['errors'] as $error) { foreach ($this->importResult['errors'] as $error) {
$html .= '<li>' . e($error) . '</li>'; $html .= '<li>' . e($error) . '</li>';
@@ -324,9 +331,4 @@ class ImportWizard extends Page
return $this->storedFilePath; return $this->storedFilePath;
} }
public function getTitle(): string|Htmlable
{
return 'Import Wizard';
}
} }

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\ActivityLogs; namespace App\Filament\Resources\ActivityLogs;
use App\Enums\NavigationGroup;
use App\Filament\Resources\ActivityLogs\Pages\ListActivityLogs; use App\Filament\Resources\ActivityLogs\Pages\ListActivityLogs;
use App\Filament\Resources\ActivityLogs\Pages\ViewActivityLog; use App\Filament\Resources\ActivityLogs\Pages\ViewActivityLog;
use App\Filament\Resources\ActivityLogs\Schemas\ActivityLogInfolist; 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|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 ?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'; 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 public static function form(Schema $schema): Schema
{ {
return $schema; return $schema;

View File

@@ -15,28 +15,28 @@ class ActivityLogInfolist
{ {
return $schema return $schema
->components([ ->components([
Section::make('Activity Details') Section::make(__('hr.sections.activity_details'))
->schema([ ->schema([
TextEntry::make('created_at') TextEntry::make('created_at')
->label('Date') ->label(__('hr.fields.date'))
->dateTime(), ->dateTime(),
TextEntry::make('description'), TextEntry::make('description'),
TextEntry::make('event') TextEntry::make('event')
->badge(), ->badge(),
TextEntry::make('log_name') TextEntry::make('log_name')
->label('Log Name'), ->label(__('hr.fields.log_name')),
TextEntry::make('subject_type') TextEntry::make('subject_type')
->label('Subject Type') ->label(__('hr.fields.subject_type'))
->formatStateUsing(fn (?string $state): string => $state ? class_basename($state) : '—'), ->formatStateUsing(fn (?string $state): string => $state ? class_basename($state) : '—'),
TextEntry::make('subject_id') TextEntry::make('subject_id')
->label('Subject ID'), ->label(__('hr.fields.subject_id')),
TextEntry::make('causer.name') TextEntry::make('causer.name')
->label('Causer'), ->label(__('hr.fields.causer')),
KeyValueEntry::make('properties.attributes') KeyValueEntry::make('properties.attributes')
->label('Changes') ->label(__('hr.fields.changes'))
->visible(fn ($record): bool => filled($record->properties['attributes'] ?? null)), ->visible(fn ($record): bool => filled($record->properties['attributes'] ?? null)),
KeyValueEntry::make('properties.old') KeyValueEntry::make('properties.old')
->label('Previous Values') ->label(__('hr.fields.previous_values'))
->visible(fn ($record): bool => filled($record->properties['old'] ?? null)), ->visible(fn ($record): bool => filled($record->properties['old'] ?? null)),
]) ])
->columns(2), ->columns(2),

View File

@@ -25,7 +25,7 @@ class ActivityLogsTable
return $table return $table
->columns([ ->columns([
TextColumn::make('created_at') TextColumn::make('created_at')
->label('Date') ->label(__('hr.fields.date'))
->dateTime() ->dateTime()
->sortable(), ->sortable(),
TextColumn::make('description') TextColumn::make('description')
@@ -36,15 +36,15 @@ class ActivityLogsTable
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('subject_type') TextColumn::make('subject_type')
->label('Subject Type') ->label(__('hr.fields.subject_type'))
->formatStateUsing(fn (?string $state): string => $state ? class_basename($state) : '—') ->formatStateUsing(fn (?string $state): string => $state ? class_basename($state) : '—')
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('subject_id') TextColumn::make('subject_id')
->label('Subject ID') ->label(__('hr.fields.subject_id'))
->sortable(), ->sortable(),
TextColumn::make('causer.name') TextColumn::make('causer.name')
->label('Causer') ->label(__('hr.fields.causer'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('log_name') TextColumn::make('log_name')
@@ -53,14 +53,14 @@ class ActivityLogsTable
->defaultSort('created_at', 'desc') ->defaultSort('created_at', 'desc')
->filters([ ->filters([
SelectFilter::make('subject_type') SelectFilter::make('subject_type')
->label('Subject Type') ->label(__('hr.fields.subject_type'))
->options([ ->options([
Employee::class => 'Employee', Employee::class => __('hr.audit.employee'),
Vacation::class => 'Vacation', Vacation::class => __('hr.audit.vacation'),
Bonus::class => 'Bonus', Bonus::class => __('hr.audit.bonus'),
DisciplinaryReport::class => 'Disciplinary Report', DisciplinaryReport::class => __('hr.audit.disciplinary_report'),
Department::class => 'Department', Department::class => __('hr.audit.department'),
User::class => 'User', User::class => __('hr.audit.user'),
]), ]),
SelectFilter::make('event') SelectFilter::make('event')
->options(fn (): array => \Spatie\Activitylog\Models\Activity::query() ->options(fn (): array => \Spatie\Activitylog\Models\Activity::query()
@@ -69,16 +69,16 @@ class ActivityLogsTable
->pluck('event', 'event') ->pluck('event', 'event')
->all()), ->all()),
SelectFilter::make('causer') SelectFilter::make('causer')
->label('Causer') ->label(__('hr.fields.causer'))
->relationship('causer', 'name') ->relationship('causer', 'name')
->searchable() ->searchable()
->preload(), ->preload(),
Filter::make('created_at') Filter::make('created_at')
->schema([ ->schema([
DatePicker::make('from') DatePicker::make('from')
->label('From'), ->label(__('hr.fields.from')),
DatePicker::make('until') DatePicker::make('until')
->label('Until'), ->label(__('hr.fields.until')),
]) ])
->query(function (Builder $query, array $data): Builder { ->query(function (Builder $query, array $data): Builder {
return $query return $query

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\Bonuses; namespace App\Filament\Resources\Bonuses;
use App\Enums\NavigationGroup;
use App\Filament\Resources\Bonuses\Pages\CreateBonus; use App\Filament\Resources\Bonuses\Pages\CreateBonus;
use App\Filament\Resources\Bonuses\Pages\EditBonus; use App\Filament\Resources\Bonuses\Pages\EditBonus;
use App\Filament\Resources\Bonuses\Pages\ListBonuses; use App\Filament\Resources\Bonuses\Pages\ListBonuses;
@@ -27,7 +28,7 @@ class BonusResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCurrencyDollar; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCurrencyDollar;
protected static string | UnitEnum | null $navigationGroup = 'Records'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Records;
protected static ?int $navigationSort = 3; protected static ?int $navigationSort = 3;

View File

@@ -13,7 +13,7 @@ class BonusInfolist
return $schema return $schema
->components([ ->components([
TextEntry::make('employee.id') TextEntry::make('employee.id')
->label('Employee'), ->label(__('hr.fields.employee')),
TextEntry::make('bonus_date') TextEntry::make('bonus_date')
->date(), ->date(),
TextEntry::make('bonus_type') TextEntry::make('bonus_type')

View File

@@ -22,14 +22,14 @@ class BonusesTable
return $table return $table
->columns([ ->columns([
TextColumn::make('employee.full_name') TextColumn::make('employee.full_name')
->label('Employee') ->label(__('hr.fields.employee'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('bonus_date') TextColumn::make('bonus_date')
->date() ->date()
->sortable(), ->sortable(),
TextColumn::make('bonus_type') TextColumn::make('bonus_type')
->label('Type') ->label(__('hr.fields.type'))
->badge() ->badge()
->color(fn (BonusType $state): string => $state->color()) ->color(fn (BonusType $state): string => $state->color())
->formatStateUsing(fn (BonusType $state): string => $state->label()) ->formatStateUsing(fn (BonusType $state): string => $state->label())
@@ -56,7 +56,7 @@ class BonusesTable
]) ])
->filters([ ->filters([
SelectFilter::make('bonus_type') SelectFilter::make('bonus_type')
->label('Type') ->label(__('hr.fields.type'))
->options(BonusType::class), ->options(BonusType::class),
TrashedFilter::make(), TrashedFilter::make(),
]) ])

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\Departments; namespace App\Filament\Resources\Departments;
use App\Enums\NavigationGroup;
use App\Filament\Resources\Departments\Pages\CreateDepartment; use App\Filament\Resources\Departments\Pages\CreateDepartment;
use App\Filament\Resources\Departments\Pages\EditDepartment; use App\Filament\Resources\Departments\Pages\EditDepartment;
use App\Filament\Resources\Departments\Pages\ListDepartments; use App\Filament\Resources\Departments\Pages\ListDepartments;
@@ -27,7 +28,7 @@ class DepartmentResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBuildingOffice2; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBuildingOffice2;
protected static string | UnitEnum | null $navigationGroup = 'Organization'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Organization;
protected static ?int $navigationSort = 1; protected static ?int $navigationSort = 1;

View File

@@ -24,7 +24,7 @@ class DepartmentForm
->rows(3) ->rows(3)
->columnSpanFull(), ->columnSpanFull(),
Toggle::make('is_active') Toggle::make('is_active')
->label('Active') ->label(__('hr.fields.active'))
->default(true) ->default(true)
->required(), ->required(),
]); ]);

View File

@@ -29,9 +29,9 @@ class DepartmentsTable
->limit(50) ->limit(50)
->toggleable(), ->toggleable(),
TextColumn::make('is_active') TextColumn::make('is_active')
->label('Status') ->label(__('hr.fields.status'))
->badge() ->badge()
->formatStateUsing(fn (bool $state): string => $state ? 'Active' : 'Inactive') ->formatStateUsing(fn (bool $state): string => $state ? __('enums.employment_status.active') : __('enums.employment_status.inactive'))
->color(fn (bool $state): string => $state ? 'success' : 'danger') ->color(fn (bool $state): string => $state ? 'success' : 'danger')
->sortable(), ->sortable(),
TextColumn::make('created_at') TextColumn::make('created_at')
@@ -49,10 +49,10 @@ class DepartmentsTable
]) ])
->filters([ ->filters([
TernaryFilter::make('is_active') TernaryFilter::make('is_active')
->label('Status') ->label(__('hr.fields.status'))
->placeholder('All departments') ->placeholder(__('hr.filters.all_departments'))
->trueLabel('Active') ->trueLabel(__('enums.employment_status.active'))
->falseLabel('Inactive'), ->falseLabel(__('enums.employment_status.inactive')),
TrashedFilter::make(), TrashedFilter::make(),
]) ])
->recordActions([ ->recordActions([

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\DisciplinaryReports; namespace App\Filament\Resources\DisciplinaryReports;
use App\Enums\NavigationGroup;
use App\Filament\Resources\DisciplinaryReports\Pages\CreateDisciplinaryReport; use App\Filament\Resources\DisciplinaryReports\Pages\CreateDisciplinaryReport;
use App\Filament\Resources\DisciplinaryReports\Pages\EditDisciplinaryReport; use App\Filament\Resources\DisciplinaryReports\Pages\EditDisciplinaryReport;
use App\Filament\Resources\DisciplinaryReports\Pages\ListDisciplinaryReports; use App\Filament\Resources\DisciplinaryReports\Pages\ListDisciplinaryReports;
@@ -27,7 +28,7 @@ class DisciplinaryReportResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedExclamationTriangle; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedExclamationTriangle;
protected static string | UnitEnum | null $navigationGroup = 'Records'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Records;
protected static ?int $navigationSort = 1; protected static ?int $navigationSort = 1;

View File

@@ -32,7 +32,7 @@ class DisciplinaryReportForm
->required() ->required()
->native(false), ->native(false),
HrForm::fileUpload('attachment_path') HrForm::fileUpload('attachment_path')
->label('Attachment') ->label(__('hr.fields.attachment'))
->acceptedFileTypes(['application/pdf', 'image/*']) ->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240), ->maxSize(10240),
]); ]);

View File

@@ -13,7 +13,7 @@ class DisciplinaryReportInfolist
return $schema return $schema
->components([ ->components([
TextEntry::make('employee.id') TextEntry::make('employee.id')
->label('Employee'), ->label(__('hr.fields.employee')),
TextEntry::make('report_date') TextEntry::make('report_date')
->date(), ->date(),
TextEntry::make('title'), TextEntry::make('title'),

View File

@@ -23,7 +23,7 @@ class DisciplinaryReportsTable
return $table return $table
->columns([ ->columns([
TextColumn::make('employee.full_name') TextColumn::make('employee.full_name')
->label('Employee') ->label(__('hr.fields.employee'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('report_date') TextColumn::make('report_date')
@@ -39,12 +39,12 @@ class DisciplinaryReportsTable
->searchable() ->searchable()
->sortable(), ->sortable(),
IconColumn::make('attachment_path') IconColumn::make('attachment_path')
->label('Attachment') ->label(__('hr.fields.attachment'))
->boolean() ->boolean()
->trueIcon('heroicon-o-paper-clip') ->trueIcon('heroicon-o-paper-clip')
->falseIcon('heroicon-o-minus'), ->falseIcon('heroicon-o-minus'),
TextColumn::make('creator.name') TextColumn::make('creator.name')
->label('Created By') ->label(__('hr.fields.created_by'))
->sortable() ->sortable()
->toggleable(), ->toggleable(),
TextColumn::make('created_at') TextColumn::make('created_at')

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\EmployeeDocuments; namespace App\Filament\Resources\EmployeeDocuments;
use App\Enums\NavigationGroup;
use App\Filament\Resources\EmployeeDocuments\Pages\CreateEmployeeDocument; use App\Filament\Resources\EmployeeDocuments\Pages\CreateEmployeeDocument;
use App\Filament\Resources\EmployeeDocuments\Pages\EditEmployeeDocument; use App\Filament\Resources\EmployeeDocuments\Pages\EditEmployeeDocument;
use App\Filament\Resources\EmployeeDocuments\Pages\ListEmployeeDocuments; use App\Filament\Resources\EmployeeDocuments\Pages\ListEmployeeDocuments;
@@ -27,7 +28,7 @@ class EmployeeDocumentResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedDocument; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedDocument;
protected static string | UnitEnum | null $navigationGroup = 'Records'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Records;
protected static ?int $navigationSort = 5; protected static ?int $navigationSort = 5;

View File

@@ -23,7 +23,7 @@ class EmployeeDocumentForm
->required() ->required()
->maxLength(255), ->maxLength(255),
HrForm::fileUpload('file_path') HrForm::fileUpload('file_path')
->label('Document') ->label(__('hr.fields.document'))
->required() ->required()
->acceptedFileTypes(['application/pdf', 'image/*', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document']) ->acceptedFileTypes(['application/pdf', 'image/*', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'])
->maxSize(15360), ->maxSize(15360),

View File

@@ -13,7 +13,7 @@ class EmployeeDocumentInfolist
return $schema return $schema
->components([ ->components([
TextEntry::make('employee.id') TextEntry::make('employee.id')
->label('Employee'), ->label(__('hr.fields.employee')),
TextEntry::make('document_type') TextEntry::make('document_type')
->badge(), ->badge(),
TextEntry::make('title'), TextEntry::make('title'),

View File

@@ -24,11 +24,11 @@ class EmployeeDocumentsTable
return $table return $table
->columns([ ->columns([
TextColumn::make('employee.full_name') TextColumn::make('employee.full_name')
->label('Employee') ->label(__('hr.fields.employee'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('document_type') TextColumn::make('document_type')
->label('Type') ->label(__('hr.fields.type'))
->badge() ->badge()
->color(fn (DocumentType $state): string => $state->color()) ->color(fn (DocumentType $state): string => $state->color())
->formatStateUsing(fn (DocumentType $state): string => $state->label()) ->formatStateUsing(fn (DocumentType $state): string => $state->label())
@@ -56,13 +56,13 @@ class EmployeeDocumentsTable
]) ])
->filters([ ->filters([
SelectFilter::make('document_type') SelectFilter::make('document_type')
->label('Type') ->label(__('hr.fields.type'))
->options(DocumentType::class), ->options(DocumentType::class),
TrashedFilter::make(), TrashedFilter::make(),
]) ])
->recordActions([ ->recordActions([
Action::make('download') Action::make('download')
->label('Download') ->label(__('hr.actions.download'))
->icon('heroicon-o-arrow-down-tray') ->icon('heroicon-o-arrow-down-tray')
->visible(fn (EmployeeDocument $record): bool => filled($record->file_path)) ->visible(fn (EmployeeDocument $record): bool => filled($record->file_path))
->action(function (EmployeeDocument $record) { ->action(function (EmployeeDocument $record) {

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\Employees; namespace App\Filament\Resources\Employees;
use App\Enums\NavigationGroup;
use App\Filament\Resources\Employees\Pages\CreateEmployee; use App\Filament\Resources\Employees\Pages\CreateEmployee;
use App\Filament\Resources\Employees\Pages\EditEmployee; use App\Filament\Resources\Employees\Pages\EditEmployee;
use App\Filament\Resources\Employees\Pages\ListEmployees; use App\Filament\Resources\Employees\Pages\ListEmployees;
@@ -36,7 +37,7 @@ class EmployeeResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedUsers; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedUsers;
protected static string | UnitEnum | null $navigationGroup = 'Employees'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Employees;
protected static ?int $navigationSort = 1; protected static ?int $navigationSort = 1;
@@ -80,9 +81,9 @@ class EmployeeResource extends Resource
{ {
/** @var Employee $record */ /** @var Employee $record */
return [ return [
'Employee #' => $record->employee_number, __('hr.fields.employee_number') => $record->employee_number,
'Department' => $record->department?->name ?? '—', __('hr.fields.department') => $record->department?->name ?? '—',
'Position' => $record->position?->name ?? '—', __('hr.fields.position') => $record->position?->name ?? '—',
]; ];
} }

View File

@@ -27,7 +27,10 @@ class BonusesRelationManager extends RelationManager
{ {
protected static string $relationship = 'bonuses'; protected static string $relationship = 'bonuses';
protected static ?string $title = 'Bonuses'; public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.bonuses");
}
public function form(Schema $schema): Schema public function form(Schema $schema): Schema
{ {
@@ -61,7 +64,7 @@ class BonusesRelationManager extends RelationManager
->date() ->date()
->sortable(), ->sortable(),
TextColumn::make('bonus_type') TextColumn::make('bonus_type')
->label('Type') ->label(__('hr.fields.type'))
->badge() ->badge()
->color(fn (BonusType $state): string => $state->color()) ->color(fn (BonusType $state): string => $state->color())
->formatStateUsing(fn (BonusType $state): string => $state->label()) ->formatStateUsing(fn (BonusType $state): string => $state->label())
@@ -75,7 +78,7 @@ class BonusesRelationManager extends RelationManager
]) ])
->filters([ ->filters([
SelectFilter::make('bonus_type') SelectFilter::make('bonus_type')
->label('Type') ->label(__('hr.fields.type'))
->options(BonusType::class), ->options(BonusType::class),
TrashedFilter::make(), TrashedFilter::make(),
]) ])

View File

@@ -29,7 +29,10 @@ class DisciplinaryReportsRelationManager extends RelationManager
{ {
protected static string $relationship = 'disciplinaryReports'; protected static string $relationship = 'disciplinaryReports';
protected static ?string $title = 'Disciplinary Reports'; public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.disciplinary_reports");
}
public function form(Schema $schema): Schema public function form(Schema $schema): Schema
{ {
@@ -50,7 +53,7 @@ class DisciplinaryReportsRelationManager extends RelationManager
->required() ->required()
->native(false), ->native(false),
HrForm::fileUpload('attachment_path') HrForm::fileUpload('attachment_path')
->label('Attachment') ->label(__('hr.fields.attachment'))
->acceptedFileTypes(['application/pdf', 'image/*']) ->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240), ->maxSize(10240),
]); ]);
@@ -73,12 +76,12 @@ class DisciplinaryReportsRelationManager extends RelationManager
->formatStateUsing(fn (DisciplinarySeverity $state): string => $state->label()) ->formatStateUsing(fn (DisciplinarySeverity $state): string => $state->label())
->sortable(), ->sortable(),
IconColumn::make('attachment_path') IconColumn::make('attachment_path')
->label('Attachment') ->label(__('hr.fields.attachment'))
->boolean() ->boolean()
->trueIcon('heroicon-o-paper-clip') ->trueIcon('heroicon-o-paper-clip')
->falseIcon('heroicon-o-minus'), ->falseIcon('heroicon-o-minus'),
TextColumn::make('creator.name') TextColumn::make('creator.name')
->label('Created By') ->label(__('hr.fields.created_by'))
->toggleable(), ->toggleable(),
]) ])
->filters([ ->filters([

View File

@@ -29,7 +29,10 @@ class DocumentsRelationManager extends RelationManager
{ {
protected static string $relationship = 'documents'; protected static string $relationship = 'documents';
protected static ?string $title = 'Employee Documents'; public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.employee_documents");
}
public function form(Schema $schema): Schema public function form(Schema $schema): Schema
{ {
@@ -43,7 +46,7 @@ class DocumentsRelationManager extends RelationManager
->required() ->required()
->maxLength(255), ->maxLength(255),
HrForm::fileUpload('file_path') HrForm::fileUpload('file_path')
->label('Document') ->label(__('hr.fields.document'))
->required() ->required()
->acceptedFileTypes(['application/pdf', 'image/*', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document']) ->acceptedFileTypes(['application/pdf', 'image/*', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'])
->maxSize(15360), ->maxSize(15360),
@@ -56,7 +59,7 @@ class DocumentsRelationManager extends RelationManager
->recordTitleAttribute('title') ->recordTitleAttribute('title')
->columns([ ->columns([
TextColumn::make('document_type') TextColumn::make('document_type')
->label('Type') ->label(__('hr.fields.type'))
->badge() ->badge()
->color(fn (DocumentType $state): string => $state->color()) ->color(fn (DocumentType $state): string => $state->color())
->formatStateUsing(fn (DocumentType $state): string => $state->label()) ->formatStateUsing(fn (DocumentType $state): string => $state->label())
@@ -71,7 +74,7 @@ class DocumentsRelationManager extends RelationManager
]) ])
->filters([ ->filters([
SelectFilter::make('document_type') SelectFilter::make('document_type')
->label('Type') ->label(__('hr.fields.type'))
->options(DocumentType::class), ->options(DocumentType::class),
TrashedFilter::make(), TrashedFilter::make(),
]) ])
@@ -80,7 +83,7 @@ class DocumentsRelationManager extends RelationManager
]) ])
->recordActions([ ->recordActions([
Action::make('download') Action::make('download')
->label('Download') ->label(__('hr.actions.download'))
->icon('heroicon-o-arrow-down-tray') ->icon('heroicon-o-arrow-down-tray')
->visible(fn (EmployeeDocument $record): bool => filled($record->file_path)) ->visible(fn (EmployeeDocument $record): bool => filled($record->file_path))
->action(function (EmployeeDocument $record) { ->action(function (EmployeeDocument $record) {

View File

@@ -26,7 +26,10 @@ class ExplanationsRelationManager extends RelationManager
{ {
protected static string $relationship = 'explanations'; protected static string $relationship = 'explanations';
protected static ?string $title = 'Explanations'; public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.explanations");
}
public function form(Schema $schema): Schema public function form(Schema $schema): Schema
{ {
@@ -43,7 +46,7 @@ class ExplanationsRelationManager extends RelationManager
->rows(4) ->rows(4)
->columnSpanFull(), ->columnSpanFull(),
HrForm::fileUpload('attachment_path') HrForm::fileUpload('attachment_path')
->label('Attachment') ->label(__('hr.fields.attachment'))
->acceptedFileTypes(['application/pdf', 'image/*']) ->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240), ->maxSize(10240),
]); ]);
@@ -64,7 +67,7 @@ class ExplanationsRelationManager extends RelationManager
->limit(50) ->limit(50)
->toggleable(), ->toggleable(),
IconColumn::make('attachment_path') IconColumn::make('attachment_path')
->label('Attachment') ->label(__('hr.fields.attachment'))
->boolean() ->boolean()
->trueIcon('heroicon-o-paper-clip') ->trueIcon('heroicon-o-paper-clip')
->falseIcon('heroicon-o-minus'), ->falseIcon('heroicon-o-minus'),

View File

@@ -24,7 +24,10 @@ class GiftsRelationManager extends RelationManager
{ {
protected static string $relationship = 'gifts'; protected static string $relationship = 'gifts';
protected static ?string $title = 'Gifts'; public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.gifts");
}
public function form(Schema $schema): Schema public function form(Schema $schema): Schema
{ {
@@ -34,7 +37,7 @@ class GiftsRelationManager extends RelationManager
->required() ->required()
->default(now()), ->default(now()),
TextInput::make('gift_name') TextInput::make('gift_name')
->label('Gift Name') ->label(__('hr.fields.gift_name'))
->required() ->required()
->maxLength(255), ->maxLength(255),
TextInput::make('value') TextInput::make('value')
@@ -59,7 +62,7 @@ class GiftsRelationManager extends RelationManager
->date() ->date()
->sortable(), ->sortable(),
TextColumn::make('gift_name') TextColumn::make('gift_name')
->label('Gift') ->label(__('hr.fields.gift'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('value') TextColumn::make('value')

View File

@@ -25,14 +25,17 @@ class SickLeavesRelationManager extends RelationManager
{ {
protected static string $relationship = 'sickLeaves'; protected static string $relationship = 'sickLeaves';
protected static ?string $title = 'Sick Leaves'; public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.sick_leaves");
}
public function form(Schema $schema): Schema public function form(Schema $schema): Schema
{ {
return $schema return $schema
->components([ ->components([
HrForm::leaveDatePicker('start_date', 'Start Date'), HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
HrForm::leaveDatePicker('end_date', 'End Date'), HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
HrForm::leaveDaysDisplay(), HrForm::leaveDaysDisplay(),
TextInput::make('medical_institution') TextInput::make('medical_institution')
->maxLength(255), ->maxLength(255),
@@ -40,7 +43,7 @@ class SickLeavesRelationManager extends RelationManager
->rows(3) ->rows(3)
->columnSpanFull(), ->columnSpanFull(),
HrForm::fileUpload('document_path') HrForm::fileUpload('document_path')
->label('Medical Document') ->label(__('hr.fields.medical_document'))
->acceptedFileTypes(['application/pdf', 'image/*']) ->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240), ->maxSize(10240),
]); ]);
@@ -64,7 +67,7 @@ class SickLeavesRelationManager extends RelationManager
->searchable() ->searchable()
->toggleable(), ->toggleable(),
IconColumn::make('document_path') IconColumn::make('document_path')
->label('Document') ->label(__('hr.fields.document'))
->boolean() ->boolean()
->trueIcon('heroicon-o-document-check') ->trueIcon('heroicon-o-document-check')
->falseIcon('heroicon-o-document'), ->falseIcon('heroicon-o-document'),

View File

@@ -29,14 +29,17 @@ class UnpaidLeavesRelationManager extends RelationManager
{ {
protected static string $relationship = 'unpaidLeaves'; protected static string $relationship = 'unpaidLeaves';
protected static ?string $title = 'Unpaid Leaves'; public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.unpaid_leaves");
}
public function form(Schema $schema): Schema public function form(Schema $schema): Schema
{ {
return $schema return $schema
->components([ ->components([
HrForm::leaveDatePicker('start_date', 'Start Date'), HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
HrForm::leaveDatePicker('end_date', 'End Date'), HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
HrForm::leaveDaysDisplay(), HrForm::leaveDaysDisplay(),
Textarea::make('reason') Textarea::make('reason')
->rows(3) ->rows(3)
@@ -64,7 +67,7 @@ class UnpaidLeavesRelationManager extends RelationManager
->formatStateUsing(fn (ApprovalStatus $state): string => $state->label()) ->formatStateUsing(fn (ApprovalStatus $state): string => $state->label())
->sortable(), ->sortable(),
TextColumn::make('approver.name') TextColumn::make('approver.name')
->label('Approved By') ->label(__('hr.fields.approved_by'))
->toggleable(isToggledHiddenByDefault: true), ->toggleable(isToggledHiddenByDefault: true),
]) ])
->filters([ ->filters([
@@ -77,7 +80,7 @@ class UnpaidLeavesRelationManager extends RelationManager
]) ])
->recordActions([ ->recordActions([
Action::make('approve') Action::make('approve')
->label('Approve') ->label(__('hr.actions.approve'))
->icon('heroicon-o-check-badge') ->icon('heroicon-o-check-badge')
->color('success') ->color('success')
->requiresConfirmation() ->requiresConfirmation()
@@ -86,7 +89,7 @@ class UnpaidLeavesRelationManager extends RelationManager
$unpaidLeaveService->approve($record, Auth::user()); $unpaidLeaveService->approve($record, Auth::user());
}), }),
Action::make('reject') Action::make('reject')
->label('Reject') ->label(__('hr.actions.reject'))
->icon('heroicon-o-x-mark') ->icon('heroicon-o-x-mark')
->color('danger') ->color('danger')
->requiresConfirmation() ->requiresConfirmation()

View File

@@ -32,7 +32,10 @@ class VacationsRelationManager extends RelationManager
{ {
protected static string $relationship = 'vacations'; protected static string $relationship = 'vacations';
protected static ?string $title = 'Vacations'; public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
{
return __("hr.relation_managers.vacations");
}
public function form(Schema $schema): Schema public function form(Schema $schema): Schema
{ {
@@ -42,16 +45,16 @@ class VacationsRelationManager extends RelationManager
->options(VacationType::class) ->options(VacationType::class)
->required() ->required()
->native(false), ->native(false),
HrForm::leaveDatePicker('start_date', 'Start Date'), HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
HrForm::leaveDatePicker('end_date', 'End Date'), HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
DatePicker::make('return_date') DatePicker::make('return_date')
->label('Return Date'), ->label(__('hr.fields.return_date')),
HrForm::leaveDaysDisplay(), HrForm::leaveDaysDisplay(),
Textarea::make('reason') Textarea::make('reason')
->rows(3) ->rows(3)
->columnSpanFull(), ->columnSpanFull(),
HrForm::fileUpload('attachment_path') HrForm::fileUpload('attachment_path')
->label('Attachment') ->label(__('hr.fields.attachment'))
->acceptedFileTypes(['application/pdf', 'image/*']) ->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240), ->maxSize(10240),
]); ]);
@@ -82,7 +85,7 @@ class VacationsRelationManager extends RelationManager
->formatStateUsing(fn (ApprovalStatus $state): string => $state->label()) ->formatStateUsing(fn (ApprovalStatus $state): string => $state->label())
->sortable(), ->sortable(),
TextColumn::make('approver.name') TextColumn::make('approver.name')
->label('Approved By') ->label(__('hr.fields.approved_by'))
->toggleable(isToggledHiddenByDefault: true), ->toggleable(isToggledHiddenByDefault: true),
]) ])
->filters([ ->filters([
@@ -97,7 +100,7 @@ class VacationsRelationManager extends RelationManager
]) ])
->recordActions([ ->recordActions([
Action::make('approve') Action::make('approve')
->label('Approve') ->label(__('hr.actions.approve'))
->icon('heroicon-o-check-badge') ->icon('heroicon-o-check-badge')
->color('success') ->color('success')
->requiresConfirmation() ->requiresConfirmation()
@@ -106,7 +109,7 @@ class VacationsRelationManager extends RelationManager
$vacationService->approve($record, Auth::user()); $vacationService->approve($record, Auth::user());
}), }),
Action::make('reject') Action::make('reject')
->label('Reject') ->label(__('hr.actions.reject'))
->icon('heroicon-o-x-mark') ->icon('heroicon-o-x-mark')
->color('danger') ->color('danger')
->requiresConfirmation() ->requiresConfirmation()

View File

@@ -19,12 +19,12 @@ class EmployeeForm
{ {
return $schema return $schema
->components([ ->components([
Tabs::make('Employee') Tabs::make(__('hr.tabs.employee'))
->tabs([ ->tabs([
Tab::make('Personal') Tab::make(__('hr.tabs.personal'))
->schema([ ->schema([
HrForm::fileUpload('profile_photo_path') HrForm::fileUpload('profile_photo_path')
->label('Photo') ->label(__('hr.fields.photo'))
->image() ->image()
->avatar() ->avatar()
->imageEditor(), ->imageEditor(),
@@ -36,7 +36,7 @@ class EmployeeForm
->required() ->required()
->maxLength(255), ->maxLength(255),
TextInput::make('national_id') TextInput::make('national_id')
->label('National ID') ->label(__('hr.fields.national_id'))
->maxLength(50), ->maxLength(50),
Select::make('gender') Select::make('gender')
->options(Gender::class) ->options(Gender::class)
@@ -53,7 +53,7 @@ class EmployeeForm
->columnSpanFull(), ->columnSpanFull(),
]) ])
->columns(2), ->columns(2),
Tab::make('Employment') Tab::make(__('hr.tabs.employment'))
->schema([ ->schema([
Select::make('department_id') Select::make('department_id')
->relationship('department', 'name') ->relationship('department', 'name')

View File

@@ -22,14 +22,14 @@ class EmployeeInfolist
{ {
return $schema return $schema
->components([ ->components([
Tabs::make('Employee Details') Tabs::make(__('hr.sections.employee_details'))
->tabs([ ->tabs([
Tab::make('Overview') Tab::make(__('hr.sections.overview'))
->schema([ ->schema([
Section::make('Profile') Section::make(__('hr.sections.profile'))
->schema([ ->schema([
ImageEntry::make('profile_photo_path') ImageEntry::make('profile_photo_path')
->label('Photo') ->label(__('hr.fields.photo'))
->disk(config('hr.file_uploads.disk')) ->disk(config('hr.file_uploads.disk'))
->visibility('private') ->visibility('private')
->circular() ->circular()
@@ -37,10 +37,10 @@ class EmployeeInfolist
->placeholder('—') ->placeholder('—')
->columnSpanFull(), ->columnSpanFull(),
TextEntry::make('employee_number') TextEntry::make('employee_number')
->label('Employee #'), ->label(__('hr.fields.employee_number')),
TextEntry::make('full_name'), TextEntry::make('full_name'),
TextEntry::make('national_id') TextEntry::make('national_id')
->label('National ID') ->label(__('hr.fields.national_id'))
->placeholder('—'), ->placeholder('—'),
TextEntry::make('gender') TextEntry::make('gender')
->badge() ->badge()
@@ -54,18 +54,18 @@ class EmployeeInfolist
->columnSpanFull(), ->columnSpanFull(),
]) ])
->columns(2), ->columns(2),
Section::make('Organization') Section::make(__('hr.navigation.organization'))
->schema([ ->schema([
TextEntry::make('department.name') TextEntry::make('department.name')
->label('Department') ->label(__('hr.fields.department'))
->badge() ->badge()
->color('info'), ->color('info'),
TextEntry::make('position.name') TextEntry::make('position.name')
->label('Position') ->label(__('hr.fields.position'))
->badge() ->badge()
->color('primary'), ->color('primary'),
TextEntry::make('shift.name') TextEntry::make('shift.name')
->label('Shift') ->label(__('hr.fields.shift'))
->badge() ->badge()
->color('gray'), ->color('gray'),
TextEntry::make('employment_status') TextEntry::make('employment_status')
@@ -75,19 +75,19 @@ class EmployeeInfolist
->icon(fn (EmploymentStatus $state): string => $state->icon()), ->icon(fn (EmploymentStatus $state): string => $state->icon()),
]) ])
->columns(2), ->columns(2),
Section::make('Employment Timeline') Section::make(__('hr.sections.employment_timeline'))
->schema([ ->schema([
TextEntry::make('hire_date') TextEntry::make('hire_date')
->label('Hire Date') ->label(__('hr.fields.hire_date'))
->date() ->date()
->icon('heroicon-o-calendar'), ->icon('heroicon-o-calendar'),
TextEntry::make('termination_date') TextEntry::make('termination_date')
->label('Termination Date') ->label(__('hr.fields.termination_date'))
->date() ->date()
->placeholder('—') ->placeholder('—')
->icon('heroicon-o-calendar-days'), ->icon('heroicon-o-calendar-days'),
TextEntry::make('tenure') TextEntry::make('tenure')
->label('Tenure') ->label(__('hr.fields.tenure'))
->state(fn (Employee $record): string => $record->hire_date ->state(fn (Employee $record): string => $record->hire_date
? $record->hire_date->diffForHumans(now(), true) ? $record->hire_date->diffForHumans(now(), true)
: '—'), : '—'),
@@ -97,78 +97,78 @@ class EmployeeInfolist
]) ])
->columns(2), ->columns(2),
]), ]),
Tab::make('Statistics') Tab::make(__('hr.sections.statistics'))
->schema([ ->schema([
Section::make('Leave & Attendance') Section::make(__('hr.sections.leave_attendance'))
->schema([ ->schema([
TextEntry::make('stats_vacation_taken') TextEntry::make('stats_vacation_taken')
->label('Vacation Taken (days)') ->label(__('hr.fields.vacation_taken_days'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationTaken) ->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationTaken)
->numeric() ->numeric()
->icon('heroicon-o-sun'), ->icon('heroicon-o-sun'),
TextEntry::make('stats_vacation_remaining') TextEntry::make('stats_vacation_remaining')
->label('Vacation Remaining (days)') ->label(__('hr.fields.vacation_remaining_days'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationRemaining) ->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationRemaining)
->numeric() ->numeric()
->color('success') ->color('success')
->icon('heroicon-o-calendar'), ->icon('heroicon-o-calendar'),
TextEntry::make('stats_sick_leave_count') TextEntry::make('stats_sick_leave_count')
->label('Sick Leave Records') ->label(__('hr.fields.sick_leave_records'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->sickLeaveCount) ->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->sickLeaveCount)
->numeric() ->numeric()
->icon('heroicon-o-heart'), ->icon('heroicon-o-heart'),
]) ])
->columns(3), ->columns(3),
Section::make('HR Records') Section::make(__('hr.sections.hr_records'))
->schema([ ->schema([
TextEntry::make('stats_reports_count') TextEntry::make('stats_reports_count')
->label('Disciplinary Reports') ->label(__('hr.fields.disciplinary_reports'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->reportsCount) ->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->reportsCount)
->numeric() ->numeric()
->icon('heroicon-o-exclamation-triangle'), ->icon('heroicon-o-exclamation-triangle'),
TextEntry::make('stats_bonuses_total') TextEntry::make('stats_bonuses_total')
->label('Total Bonuses') ->label(__('hr.fields.total_bonuses'))
->state(fn (Employee $record): float => app(EmployeeStatisticsService::class)->summary($record)->bonusesTotal) ->state(fn (Employee $record): float => app(EmployeeStatisticsService::class)->summary($record)->bonusesTotal)
->money('TMT') ->money('TMT')
->icon('heroicon-o-banknotes'), ->icon('heroicon-o-banknotes'),
TextEntry::make('stats_gifts_count') TextEntry::make('stats_gifts_count')
->label('Gifts Received') ->label(__('hr.fields.gifts_received'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->giftsCount) ->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->giftsCount)
->numeric() ->numeric()
->icon('heroicon-o-gift'), ->icon('heroicon-o-gift'),
]) ])
->columns(3), ->columns(3),
]), ]),
Tab::make('Leave Summary') Tab::make(__('hr.sections.leave_summary'))
->schema([ ->schema([
Section::make('Annual Leave Balance') Section::make(__('hr.sections.annual_leave_balance'))
->schema([ ->schema([
TextEntry::make('leave_balance_taken') TextEntry::make('leave_balance_taken')
->label('Days Taken') ->label(__('hr.fields.days_taken'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationTaken) ->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationTaken)
->suffix(' days'), ->suffix(' ' . __('hr.messages.days_suffix')),
TextEntry::make('leave_balance_remaining') TextEntry::make('leave_balance_remaining')
->label('Days Remaining') ->label(__('hr.fields.days_remaining'))
->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationRemaining) ->state(fn (Employee $record): int => app(EmployeeStatisticsService::class)->summary($record)->vacationRemaining)
->suffix(' days') ->suffix(' ' . __('hr.messages.days_suffix'))
->color('success'), ->color('success'),
TextEntry::make('leave_balance_total') TextEntry::make('leave_balance_total')
->label('Annual Allowance') ->label(__('hr.fields.annual_allowance'))
->state(fn (): int => (int) config('hr.annual_leave_days')) ->state(fn (): int => (int) config('hr.annual_leave_days'))
->suffix(' days'), ->suffix(' ' . __('hr.messages.days_suffix')),
]) ])
->columns(3), ->columns(3),
Section::make('Upcoming Approved Leave') Section::make(__('hr.sections.upcoming_approved_leave'))
->schema([ ->schema([
TextEntry::make('upcoming_leave') TextEntry::make('upcoming_leave')
->label('Scheduled Vacations') ->label(__('hr.fields.scheduled_vacations'))
->state(function (Employee $record): string { ->state(function (Employee $record): string {
$upcoming = app(EmployeeStatisticsService::class) $upcoming = app(EmployeeStatisticsService::class)
->summary($record) ->summary($record)
->upcomingLeave; ->upcomingLeave;
if ($upcoming->isEmpty()) { if ($upcoming->isEmpty()) {
return 'No upcoming approved leave'; return __('hr.messages.no_upcoming_approved_leave');
} }
return $upcoming return $upcoming
@@ -184,14 +184,14 @@ class EmployeeInfolist
->listWithLineBreaks() ->listWithLineBreaks()
->columnSpanFull(), ->columnSpanFull(),
]), ]),
Section::make('Other Leave Types') Section::make(__('hr.sections.other_leave_types'))
->schema([ ->schema([
TextEntry::make('unpaid_leaves_count') TextEntry::make('unpaid_leaves_count')
->label('Unpaid Leave Records') ->label(__('hr.fields.unpaid_leave_records'))
->state(fn (Employee $record): int => $record->unpaidLeaves()->count()) ->state(fn (Employee $record): int => $record->unpaidLeaves()->count())
->numeric(), ->numeric(),
TextEntry::make('explanations_count') TextEntry::make('explanations_count')
->label('Explanations') ->label(__('hr.fields.explanations'))
->state(fn (Employee $record): int => $record->explanations()->count()) ->state(fn (Employee $record): int => $record->explanations()->count())
->numeric(), ->numeric(),
]) ])

View File

@@ -28,14 +28,14 @@ class EmployeesTable
return $table return $table
->columns([ ->columns([
TextColumn::make('employee_number') TextColumn::make('employee_number')
->label('Number') ->label(__('hr.fields.number'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('full_name') TextColumn::make('full_name')
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('national_id') TextColumn::make('national_id')
->label('National ID') ->label(__('hr.fields.national_id'))
->searchable() ->searchable()
->toggleable(), ->toggleable(),
TextColumn::make('gender') TextColumn::make('gender')
@@ -47,25 +47,25 @@ class EmployeesTable
->searchable() ->searchable()
->toggleable(), ->toggleable(),
TextColumn::make('department.name') TextColumn::make('department.name')
->label('Department') ->label(__('hr.fields.department'))
->badge() ->badge()
->color('info') ->color('info')
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('position.name') TextColumn::make('position.name')
->label('Position') ->label(__('hr.fields.position'))
->badge() ->badge()
->color('primary') ->color('primary')
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('shift.name') TextColumn::make('shift.name')
->label('Shift') ->label(__('hr.fields.shift'))
->badge() ->badge()
->color('gray') ->color('gray')
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('employment_status') TextColumn::make('employment_status')
->label('Status') ->label(__('hr.fields.status'))
->badge() ->badge()
->color(fn (EmploymentStatus $state): string => $state->color()) ->color(fn (EmploymentStatus $state): string => $state->color())
->formatStateUsing(fn (EmploymentStatus $state): string => $state->label()) ->formatStateUsing(fn (EmploymentStatus $state): string => $state->label())
@@ -93,22 +93,22 @@ class EmployeesTable
]) ])
->filters([ ->filters([
SelectFilter::make('department_id') SelectFilter::make('department_id')
->label('Department') ->label(__('hr.fields.department'))
->relationship('department', 'name') ->relationship('department', 'name')
->searchable() ->searchable()
->preload(), ->preload(),
SelectFilter::make('position_id') SelectFilter::make('position_id')
->label('Position') ->label(__('hr.fields.position'))
->relationship('position', 'name') ->relationship('position', 'name')
->searchable() ->searchable()
->preload(), ->preload(),
SelectFilter::make('shift_id') SelectFilter::make('shift_id')
->label('Shift') ->label(__('hr.fields.shift'))
->relationship('shift', 'name') ->relationship('shift', 'name')
->searchable() ->searchable()
->preload(), ->preload(),
SelectFilter::make('employment_status') SelectFilter::make('employment_status')
->label('Employment Status') ->label(__('hr.fields.employment_status'))
->options(EmploymentStatus::class), ->options(EmploymentStatus::class),
TrashedFilter::make(), TrashedFilter::make(),
]) ])
@@ -120,11 +120,11 @@ class EmployeesTable
BulkActionGroup::make([ BulkActionGroup::make([
ExportExcelAction::bulk('exportSelected', \App\Exports\EmployeesExport::class, 'employees.xlsx'), ExportExcelAction::bulk('exportSelected', \App\Exports\EmployeesExport::class, 'employees.xlsx'),
BulkAction::make('changeDepartment') BulkAction::make('changeDepartment')
->label('Change Department') ->label(__('hr.actions.change_department'))
->icon('heroicon-o-building-office-2') ->icon('heroicon-o-building-office-2')
->schema([ ->schema([
Select::make('department_id') Select::make('department_id')
->label('Department') ->label(__('hr.fields.department'))
->options(fn (): array => Department::query()->orderBy('name')->pluck('name', 'id')->all()) ->options(fn (): array => Department::query()->orderBy('name')->pluck('name', 'id')->all())
->searchable() ->searchable()
->required(), ->required(),

View File

@@ -22,23 +22,23 @@ class EmployeeStatsWidget extends StatsOverviewWidget
$summary = app(EmployeeStatisticsService::class)->summary($this->record); $summary = app(EmployeeStatisticsService::class)->summary($this->record);
return [ return [
Stat::make('Vacation Taken', (string) $summary->vacationTaken) Stat::make(__('hr.fields.vacation_taken_days'), (string) $summary->vacationTaken)
->description("{$summary->vacationRemaining} days remaining") ->description("{$summary->vacationRemaining} " . __('hr.fields.days_remaining'))
->descriptionIcon('heroicon-o-calendar') ->descriptionIcon('heroicon-o-calendar')
->color('primary') ->color('primary')
->icon('heroicon-o-sun'), ->icon('heroicon-o-sun'),
Stat::make('Sick Leaves', (string) $summary->sickLeaveCount) Stat::make(__('hr.relation_managers.sick_leaves'), (string) $summary->sickLeaveCount)
->description('Total records') ->description(__('hr.fields.sick_leave_records'))
->descriptionIcon('heroicon-o-heart') ->descriptionIcon('heroicon-o-heart')
->color('warning') ->color('warning')
->icon('heroicon-o-heart'), ->icon('heroicon-o-heart'),
Stat::make('Disciplinary Reports', (string) $summary->reportsCount) Stat::make(__('hr.fields.disciplinary_reports'), (string) $summary->reportsCount)
->description('On file') ->description(__('hr.fields.disciplinary_reports'))
->descriptionIcon('heroicon-o-exclamation-triangle') ->descriptionIcon('heroicon-o-exclamation-triangle')
->color('danger') ->color('danger')
->icon('heroicon-o-exclamation-triangle'), ->icon('heroicon-o-exclamation-triangle'),
Stat::make('Total Bonuses', number_format($summary->bonusesTotal, 2).' TMT') Stat::make(__('hr.fields.total_bonuses'), number_format($summary->bonusesTotal, 2).' TMT')
->description("{$summary->giftsCount} gifts received") ->description("{$summary->giftsCount} " . __('hr.fields.gifts_received'))
->descriptionIcon('heroicon-o-gift') ->descriptionIcon('heroicon-o-gift')
->color('success') ->color('success')
->icon('heroicon-o-banknotes'), ->icon('heroicon-o-banknotes'),

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\Explanations; namespace App\Filament\Resources\Explanations;
use App\Enums\NavigationGroup;
use App\Filament\Resources\Explanations\Pages\CreateExplanation; use App\Filament\Resources\Explanations\Pages\CreateExplanation;
use App\Filament\Resources\Explanations\Pages\EditExplanation; use App\Filament\Resources\Explanations\Pages\EditExplanation;
use App\Filament\Resources\Explanations\Pages\ListExplanations; use App\Filament\Resources\Explanations\Pages\ListExplanations;
@@ -27,7 +28,7 @@ class ExplanationResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedDocumentText; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedDocumentText;
protected static string | UnitEnum | null $navigationGroup = 'Records'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Records;
protected static ?int $navigationSort = 2; protected static ?int $navigationSort = 2;

View File

@@ -26,7 +26,7 @@ class ExplanationForm
->rows(4) ->rows(4)
->columnSpanFull(), ->columnSpanFull(),
HrForm::fileUpload('attachment_path') HrForm::fileUpload('attachment_path')
->label('Attachment') ->label(__('hr.fields.attachment'))
->acceptedFileTypes(['application/pdf', 'image/*']) ->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240), ->maxSize(10240),
]); ]);

View File

@@ -13,7 +13,7 @@ class ExplanationInfolist
return $schema return $schema
->components([ ->components([
TextEntry::make('employee.id') TextEntry::make('employee.id')
->label('Employee'), ->label(__('hr.fields.employee')),
TextEntry::make('explanation_date') TextEntry::make('explanation_date')
->date(), ->date(),
TextEntry::make('reason'), TextEntry::make('reason'),

View File

@@ -20,7 +20,7 @@ class ExplanationsTable
return $table return $table
->columns([ ->columns([
TextColumn::make('employee.full_name') TextColumn::make('employee.full_name')
->label('Employee') ->label(__('hr.fields.employee'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('explanation_date') TextColumn::make('explanation_date')
@@ -33,7 +33,7 @@ class ExplanationsTable
->limit(50) ->limit(50)
->toggleable(), ->toggleable(),
IconColumn::make('attachment_path') IconColumn::make('attachment_path')
->label('Attachment') ->label(__('hr.fields.attachment'))
->boolean() ->boolean()
->trueIcon('heroicon-o-paper-clip') ->trueIcon('heroicon-o-paper-clip')
->falseIcon('heroicon-o-minus'), ->falseIcon('heroicon-o-minus'),

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\Gifts; namespace App\Filament\Resources\Gifts;
use App\Enums\NavigationGroup;
use App\Filament\Resources\Gifts\Pages\CreateGift; use App\Filament\Resources\Gifts\Pages\CreateGift;
use App\Filament\Resources\Gifts\Pages\EditGift; use App\Filament\Resources\Gifts\Pages\EditGift;
use App\Filament\Resources\Gifts\Pages\ListGifts; use App\Filament\Resources\Gifts\Pages\ListGifts;
@@ -27,7 +28,7 @@ class GiftResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedGift; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedGift;
protected static string | UnitEnum | null $navigationGroup = 'Records'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Records;
protected static ?int $navigationSort = 4; protected static ?int $navigationSort = 4;

View File

@@ -19,7 +19,7 @@ class GiftForm
->required() ->required()
->default(now()), ->default(now()),
TextInput::make('gift_name') TextInput::make('gift_name')
->label('Gift Name') ->label(__('hr.fields.gift_name'))
->required() ->required()
->maxLength(255), ->maxLength(255),
TextInput::make('value') TextInput::make('value')

View File

@@ -13,7 +13,7 @@ class GiftInfolist
return $schema return $schema
->components([ ->components([
TextEntry::make('employee.id') TextEntry::make('employee.id')
->label('Employee'), ->label(__('hr.fields.employee')),
TextEntry::make('gift_date') TextEntry::make('gift_date')
->date(), ->date(),
TextEntry::make('gift_name'), TextEntry::make('gift_name'),

View File

@@ -19,14 +19,14 @@ class GiftsTable
return $table return $table
->columns([ ->columns([
TextColumn::make('employee.full_name') TextColumn::make('employee.full_name')
->label('Employee') ->label(__('hr.fields.employee'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('gift_date') TextColumn::make('gift_date')
->date() ->date()
->sortable(), ->sortable(),
TextColumn::make('gift_name') TextColumn::make('gift_name')
->label('Gift') ->label(__('hr.fields.gift'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('value') TextColumn::make('value')

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\Positions; namespace App\Filament\Resources\Positions;
use App\Enums\NavigationGroup;
use App\Filament\Resources\Positions\Pages\CreatePosition; use App\Filament\Resources\Positions\Pages\CreatePosition;
use App\Filament\Resources\Positions\Pages\EditPosition; use App\Filament\Resources\Positions\Pages\EditPosition;
use App\Filament\Resources\Positions\Pages\ListPositions; use App\Filament\Resources\Positions\Pages\ListPositions;
@@ -27,7 +28,7 @@ class PositionResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBriefcase; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBriefcase;
protected static string | UnitEnum | null $navigationGroup = 'Organization'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Organization;
protected static ?int $navigationSort = 2; protected static ?int $navigationSort = 2;

View File

@@ -22,18 +22,18 @@ class ShiftForm
->maxLength(50) ->maxLength(50)
->unique(ignoreRecord: true), ->unique(ignoreRecord: true),
TimePicker::make('starts_at') TimePicker::make('starts_at')
->label('Starts at') ->label(__('hr.fields.starts_at'))
->required() ->required()
->seconds(false), ->seconds(false),
TimePicker::make('ends_at') TimePicker::make('ends_at')
->label('Ends at') ->label(__('hr.fields.ends_at'))
->required() ->required()
->seconds(false), ->seconds(false),
Textarea::make('description') Textarea::make('description')
->rows(3) ->rows(3)
->columnSpanFull(), ->columnSpanFull(),
Toggle::make('is_active') Toggle::make('is_active')
->label('Active') ->label(__('hr.fields.active'))
->default(true) ->default(true)
->required(), ->required(),
]); ]);

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\Shifts; namespace App\Filament\Resources\Shifts;
use App\Enums\NavigationGroup;
use App\Filament\Resources\Shifts\Pages\CreateShift; use App\Filament\Resources\Shifts\Pages\CreateShift;
use App\Filament\Resources\Shifts\Pages\EditShift; use App\Filament\Resources\Shifts\Pages\EditShift;
use App\Filament\Resources\Shifts\Pages\ListShifts; use App\Filament\Resources\Shifts\Pages\ListShifts;
@@ -27,7 +28,7 @@ class ShiftResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedClock; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedClock;
protected static string | UnitEnum | null $navigationGroup = 'Organization'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::Organization;
protected static ?int $navigationSort = 3; protected static ?int $navigationSort = 3;

View File

@@ -26,20 +26,20 @@ class ShiftsTable
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('starts_at') TextColumn::make('starts_at')
->label('Starts') ->label(__('hr.fields.starts'))
->time() ->time()
->sortable(), ->sortable(),
TextColumn::make('ends_at') TextColumn::make('ends_at')
->label('Ends') ->label(__('hr.fields.ends'))
->time() ->time()
->sortable(), ->sortable(),
TextColumn::make('description') TextColumn::make('description')
->limit(50) ->limit(50)
->toggleable(), ->toggleable(),
TextColumn::make('is_active') TextColumn::make('is_active')
->label('Status') ->label(__('hr.fields.status'))
->badge() ->badge()
->formatStateUsing(fn (bool $state): string => $state ? 'Active' : 'Inactive') ->formatStateUsing(fn (bool $state): string => $state ? __('enums.employment_status.active') : __('enums.employment_status.inactive'))
->color(fn (bool $state): string => $state ? 'success' : 'danger') ->color(fn (bool $state): string => $state ? 'success' : 'danger')
->sortable(), ->sortable(),
TextColumn::make('created_at') TextColumn::make('created_at')
@@ -57,10 +57,10 @@ class ShiftsTable
]) ])
->filters([ ->filters([
TernaryFilter::make('is_active') TernaryFilter::make('is_active')
->label('Status') ->label(__('hr.fields.status'))
->placeholder('All shifts') ->placeholder(__('hr.filters.all_shifts'))
->trueLabel('Active') ->trueLabel(__('enums.employment_status.active'))
->falseLabel('Inactive'), ->falseLabel(__('enums.employment_status.inactive')),
TrashedFilter::make(), TrashedFilter::make(),
]) ])
->recordActions([ ->recordActions([

View File

@@ -14,8 +14,8 @@ class SickLeaveForm
return $schema return $schema
->components([ ->components([
HrForm::employeeSelect(), HrForm::employeeSelect(),
HrForm::leaveDatePicker('start_date', 'Start Date'), HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
HrForm::leaveDatePicker('end_date', 'End Date'), HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
HrForm::leaveDaysDisplay(), HrForm::leaveDaysDisplay(),
TextInput::make('medical_institution') TextInput::make('medical_institution')
->maxLength(255), ->maxLength(255),
@@ -23,7 +23,7 @@ class SickLeaveForm
->rows(3) ->rows(3)
->columnSpanFull(), ->columnSpanFull(),
HrForm::fileUpload('document_path') HrForm::fileUpload('document_path')
->label('Medical Document') ->label(__('hr.fields.medical_document'))
->acceptedFileTypes(['application/pdf', 'image/*']) ->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240), ->maxSize(10240),
]); ]);

View File

@@ -13,7 +13,7 @@ class SickLeaveInfolist
return $schema return $schema
->components([ ->components([
TextEntry::make('employee.id') TextEntry::make('employee.id')
->label('Employee'), ->label(__('hr.fields.employee')),
TextEntry::make('start_date') TextEntry::make('start_date')
->date(), ->date(),
TextEntry::make('end_date') TextEntry::make('end_date')

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\SickLeaves; namespace App\Filament\Resources\SickLeaves;
use App\Enums\NavigationGroup;
use App\Filament\Resources\SickLeaves\Pages\CreateSickLeave; use App\Filament\Resources\SickLeaves\Pages\CreateSickLeave;
use App\Filament\Resources\SickLeaves\Pages\EditSickLeave; use App\Filament\Resources\SickLeaves\Pages\EditSickLeave;
use App\Filament\Resources\SickLeaves\Pages\ListSickLeaves; use App\Filament\Resources\SickLeaves\Pages\ListSickLeaves;
@@ -27,7 +28,7 @@ class SickLeaveResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedHeart; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedHeart;
protected static string | UnitEnum | null $navigationGroup = 'Leave Management'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::LeaveManagement;
protected static ?int $navigationSort = 2; protected static ?int $navigationSort = 2;

View File

@@ -20,7 +20,7 @@ class SickLeavesTable
return $table return $table
->columns([ ->columns([
TextColumn::make('employee.full_name') TextColumn::make('employee.full_name')
->label('Employee') ->label(__('hr.fields.employee'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('start_date') TextColumn::make('start_date')
@@ -36,7 +36,7 @@ class SickLeavesTable
->searchable() ->searchable()
->toggleable(), ->toggleable(),
IconColumn::make('document_path') IconColumn::make('document_path')
->label('Document') ->label(__('hr.fields.document'))
->boolean() ->boolean()
->trueIcon('heroicon-o-document-check') ->trueIcon('heroicon-o-document-check')
->falseIcon('heroicon-o-document') ->falseIcon('heroicon-o-document')

View File

@@ -13,8 +13,8 @@ class UnpaidLeaveForm
return $schema return $schema
->components([ ->components([
HrForm::employeeSelect(), HrForm::employeeSelect(),
HrForm::leaveDatePicker('start_date', 'Start Date'), HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
HrForm::leaveDatePicker('end_date', 'End Date'), HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
HrForm::leaveDaysDisplay(), HrForm::leaveDaysDisplay(),
Textarea::make('reason') Textarea::make('reason')
->rows(3) ->rows(3)

View File

@@ -13,7 +13,7 @@ class UnpaidLeaveInfolist
return $schema return $schema
->components([ ->components([
TextEntry::make('employee.id') TextEntry::make('employee.id')
->label('Employee'), ->label(__('hr.fields.employee')),
TextEntry::make('start_date') TextEntry::make('start_date')
->date(), ->date(),
TextEntry::make('end_date') TextEntry::make('end_date')

View File

@@ -28,7 +28,7 @@ class UnpaidLeavesTable
return $table return $table
->columns([ ->columns([
TextColumn::make('employee.full_name') TextColumn::make('employee.full_name')
->label('Employee') ->label(__('hr.fields.employee'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('start_date') TextColumn::make('start_date')
@@ -47,7 +47,7 @@ class UnpaidLeavesTable
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('approver.name') TextColumn::make('approver.name')
->label('Approved By') ->label(__('hr.fields.approved_by'))
->toggleable(isToggledHiddenByDefault: true), ->toggleable(isToggledHiddenByDefault: true),
TextColumn::make('approved_at') TextColumn::make('approved_at')
->dateTime() ->dateTime()
@@ -70,12 +70,12 @@ class UnpaidLeavesTable
SelectFilter::make('status') SelectFilter::make('status')
->options(ApprovalStatus::class), ->options(ApprovalStatus::class),
Filter::make('date_range') Filter::make('date_range')
->label('Date Range') ->label(__('hr.fields.date_range'))
->schema([ ->schema([
DatePicker::make('start_from') DatePicker::make('start_from')
->label('Start from'), ->label(__('hr.fields.start_from')),
DatePicker::make('start_until') DatePicker::make('start_until')
->label('Start until'), ->label(__('hr.fields.start_until')),
]) ])
->query(function (Builder $query, array $data): Builder { ->query(function (Builder $query, array $data): Builder {
return $query return $query
@@ -92,7 +92,7 @@ class UnpaidLeavesTable
]) ])
->recordActions([ ->recordActions([
Action::make('approve') Action::make('approve')
->label('Approve') ->label(__('hr.actions.approve'))
->icon('heroicon-o-check-badge') ->icon('heroicon-o-check-badge')
->color('success') ->color('success')
->requiresConfirmation() ->requiresConfirmation()
@@ -101,7 +101,7 @@ class UnpaidLeavesTable
$unpaidLeaveService->approve($record, Auth::user()); $unpaidLeaveService->approve($record, Auth::user());
}), }),
Action::make('reject') Action::make('reject')
->label('Reject') ->label(__('hr.actions.reject'))
->icon('heroicon-o-x-mark') ->icon('heroicon-o-x-mark')
->color('danger') ->color('danger')
->requiresConfirmation() ->requiresConfirmation()

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\UnpaidLeaves; namespace App\Filament\Resources\UnpaidLeaves;
use App\Enums\NavigationGroup;
use App\Filament\Resources\UnpaidLeaves\Pages\CreateUnpaidLeave; use App\Filament\Resources\UnpaidLeaves\Pages\CreateUnpaidLeave;
use App\Filament\Resources\UnpaidLeaves\Pages\EditUnpaidLeave; use App\Filament\Resources\UnpaidLeaves\Pages\EditUnpaidLeave;
use App\Filament\Resources\UnpaidLeaves\Pages\ListUnpaidLeaves; use App\Filament\Resources\UnpaidLeaves\Pages\ListUnpaidLeaves;
@@ -27,7 +28,7 @@ class UnpaidLeaveResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCalendarDays; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCalendarDays;
protected static string | UnitEnum | null $navigationGroup = 'Leave Management'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::LeaveManagement;
protected static ?int $navigationSort = 3; protected static ?int $navigationSort = 3;

View File

@@ -19,7 +19,7 @@ class UserForm
->required() ->required()
->maxLength(255), ->maxLength(255),
TextInput::make('email') TextInput::make('email')
->label('Email address') ->label(__('hr.fields.email_address'))
->email() ->email()
->required() ->required()
->maxLength(255) ->maxLength(255)
@@ -34,7 +34,14 @@ class UserForm
->relationship('department', 'name') ->relationship('department', 'name')
->searchable() ->searchable()
->preload() ->preload()
->label('Department (for managers)'), ->label(__('hr.fields.department_for_managers')),
Select::make('locale')
->label(__('hr.fields.locale'))
->options(collect(config('hr.supported_locales'))
->mapWithKeys(fn (string $locale): array => [$locale => config('hr.locale_labels')[$locale]])
->all())
->required()
->default(config('hr.default_locale')),
Select::make('roles') Select::make('roles')
->relationship('roles', 'name') ->relationship('roles', 'name')
->multiple() ->multiple()

View File

@@ -13,7 +13,7 @@ class UserInfolist
->components([ ->components([
TextEntry::make('name'), TextEntry::make('name'),
TextEntry::make('email') TextEntry::make('email')
->label('Email address'), ->label(__('hr.fields.email_address')),
TextEntry::make('email_verified_at') TextEntry::make('email_verified_at')
->dateTime() ->dateTime()
->placeholder('-'), ->placeholder('-'),
@@ -24,7 +24,7 @@ class UserInfolist
->dateTime() ->dateTime()
->placeholder('-'), ->placeholder('-'),
TextEntry::make('department.name') TextEntry::make('department.name')
->label('Department') ->label(__('hr.fields.department'))
->placeholder('-'), ->placeholder('-'),
]); ]);
} }

View File

@@ -18,7 +18,7 @@ class UsersTable
TextColumn::make('name') TextColumn::make('name')
->searchable(), ->searchable(),
TextColumn::make('email') TextColumn::make('email')
->label('Email address') ->label(__('hr.fields.email_address'))
->searchable(), ->searchable(),
TextColumn::make('email_verified_at') TextColumn::make('email_verified_at')
->dateTime() ->dateTime()

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\Users; namespace App\Filament\Resources\Users;
use App\Enums\NavigationGroup;
use App\Filament\Resources\Users\Pages\CreateUser; use App\Filament\Resources\Users\Pages\CreateUser;
use App\Filament\Resources\Users\Pages\EditUser; use App\Filament\Resources\Users\Pages\EditUser;
use App\Filament\Resources\Users\Pages\ListUsers; use App\Filament\Resources\Users\Pages\ListUsers;
@@ -17,6 +18,7 @@ use Filament\Resources\Resource;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon; use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table; use Filament\Tables\Table;
use UnitEnum;
class UserResource extends Resource class UserResource extends Resource
{ {
@@ -24,7 +26,7 @@ class UserResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedUsers; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedUsers;
protected static string|\UnitEnum|null $navigationGroup = 'System'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::System;
protected static ?int $navigationSort = 2; protected static ?int $navigationSort = 2;

View File

@@ -20,16 +20,16 @@ class VacationForm
->options(VacationType::class) ->options(VacationType::class)
->required() ->required()
->native(false), ->native(false),
HrForm::leaveDatePicker('start_date', 'Start Date'), HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
HrForm::leaveDatePicker('end_date', 'End Date'), HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
DatePicker::make('return_date') DatePicker::make('return_date')
->label('Return Date'), ->label(__('hr.fields.return_date')),
HrForm::leaveDaysDisplay(), HrForm::leaveDaysDisplay(),
Textarea::make('reason') Textarea::make('reason')
->rows(3) ->rows(3)
->columnSpanFull(), ->columnSpanFull(),
HrForm::fileUpload('attachment_path') HrForm::fileUpload('attachment_path')
->label('Attachment') ->label(__('hr.fields.attachment'))
->acceptedFileTypes(['application/pdf', 'image/*']) ->acceptedFileTypes(['application/pdf', 'image/*'])
->maxSize(10240), ->maxSize(10240),
]); ]);

View File

@@ -13,7 +13,7 @@ class VacationInfolist
return $schema return $schema
->components([ ->components([
TextEntry::make('employee.id') TextEntry::make('employee.id')
->label('Employee'), ->label(__('hr.fields.employee')),
TextEntry::make('type') TextEntry::make('type')
->badge(), ->badge(),
TextEntry::make('start_date') TextEntry::make('start_date')

View File

@@ -30,7 +30,7 @@ class VacationsTable
return $table return $table
->columns([ ->columns([
TextColumn::make('employee.full_name') TextColumn::make('employee.full_name')
->label('Employee') ->label(__('hr.fields.employee'))
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('type') TextColumn::make('type')
@@ -55,7 +55,7 @@ class VacationsTable
->searchable() ->searchable()
->sortable(), ->sortable(),
TextColumn::make('approver.name') TextColumn::make('approver.name')
->label('Approved By') ->label(__('hr.fields.approved_by'))
->toggleable(isToggledHiddenByDefault: true), ->toggleable(isToggledHiddenByDefault: true),
TextColumn::make('approved_at') TextColumn::make('approved_at')
->dateTime() ->dateTime()
@@ -80,12 +80,12 @@ class VacationsTable
SelectFilter::make('type') SelectFilter::make('type')
->options(VacationType::class), ->options(VacationType::class),
Filter::make('date_range') Filter::make('date_range')
->label('Date Range') ->label(__('hr.fields.date_range'))
->schema([ ->schema([
DatePicker::make('start_from') DatePicker::make('start_from')
->label('Start from'), ->label(__('hr.fields.start_from')),
DatePicker::make('start_until') DatePicker::make('start_until')
->label('Start until'), ->label(__('hr.fields.start_until')),
]) ])
->query(function (Builder $query, array $data): Builder { ->query(function (Builder $query, array $data): Builder {
return $query return $query
@@ -102,7 +102,7 @@ class VacationsTable
]) ])
->recordActions([ ->recordActions([
Action::make('approve') Action::make('approve')
->label('Approve') ->label(__('hr.actions.approve'))
->icon('heroicon-o-check-badge') ->icon('heroicon-o-check-badge')
->color('success') ->color('success')
->requiresConfirmation() ->requiresConfirmation()
@@ -111,7 +111,7 @@ class VacationsTable
$vacationService->approve($record, Auth::user()); $vacationService->approve($record, Auth::user());
}), }),
Action::make('reject') Action::make('reject')
->label('Reject') ->label(__('hr.actions.reject'))
->icon('heroicon-o-x-mark') ->icon('heroicon-o-x-mark')
->color('danger') ->color('danger')
->requiresConfirmation() ->requiresConfirmation()

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Filament\Resources\Vacations; namespace App\Filament\Resources\Vacations;
use App\Enums\NavigationGroup;
use App\Filament\Resources\Vacations\Pages\CreateVacation; use App\Filament\Resources\Vacations\Pages\CreateVacation;
use App\Filament\Resources\Vacations\Pages\EditVacation; use App\Filament\Resources\Vacations\Pages\EditVacation;
use App\Filament\Resources\Vacations\Pages\ListVacations; use App\Filament\Resources\Vacations\Pages\ListVacations;
@@ -27,7 +28,7 @@ class VacationResource extends Resource
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedSun; protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedSun;
protected static string | UnitEnum | null $navigationGroup = 'Leave Management'; protected static string|UnitEnum|null $navigationGroup = NavigationGroup::LeaveManagement;
protected static ?int $navigationSort = 1; protected static ?int $navigationSort = 1;

View File

@@ -18,7 +18,7 @@ class ExportExcelAction
public static function make(string $name, string $exportClass, string $filename): Action public static function make(string $name, string $exportClass, string $filename): Action
{ {
return Action::make($name) return Action::make($name)
->label('Export') ->label(__('hr.actions.export'))
->icon('heroicon-o-arrow-down-tray') ->icon('heroicon-o-arrow-down-tray')
->action(fn (): BinaryFileResponse => Excel::download(new $exportClass, $filename)); ->action(fn (): BinaryFileResponse => Excel::download(new $exportClass, $filename));
} }
@@ -29,7 +29,7 @@ class ExportExcelAction
public static function bulk(string $name, string $exportClass, string $filename): BulkAction public static function bulk(string $name, string $exportClass, string $filename): BulkAction
{ {
return BulkAction::make($name) return BulkAction::make($name)
->label('Export Selected') ->label(__('hr.actions.export_selected'))
->icon('heroicon-o-arrow-down-tray') ->icon('heroicon-o-arrow-down-tray')
->action(function (Collection $records) use ($exportClass, $filename): BinaryFileResponse { ->action(function (Collection $records) use ($exportClass, $filename): BinaryFileResponse {
$ids = $records->pluck('id')->all(); $ids = $records->pluck('id')->all();

View File

@@ -15,7 +15,7 @@ class ExportPdfAction
public static function employeeProfile(): Action public static function employeeProfile(): Action
{ {
return Action::make('exportPdf') return Action::make('exportPdf')
->label('Export PDF') ->label(__('hr.actions.export_pdf'))
->icon('heroicon-o-document-arrow-down') ->icon('heroicon-o-document-arrow-down')
->action(fn (Employee $record, PdfExportService $pdf) => $pdf->employeeProfile($record)); ->action(fn (Employee $record, PdfExportService $pdf) => $pdf->employeeProfile($record));
} }
@@ -23,7 +23,7 @@ class ExportPdfAction
public static function employeeLeaveSummary(): Action public static function employeeLeaveSummary(): Action
{ {
return Action::make('exportLeavePdf') return Action::make('exportLeavePdf')
->label('Leave Summary PDF') ->label(__('hr.actions.leave_summary_pdf'))
->icon('heroicon-o-document-text') ->icon('heroicon-o-document-text')
->action(fn (Employee $record, PdfExportService $pdf) => $pdf->leaveSummary($record)); ->action(fn (Employee $record, PdfExportService $pdf) => $pdf->leaveSummary($record));
} }
@@ -31,7 +31,7 @@ class ExportPdfAction
public static function employeeList(): Action public static function employeeList(): Action
{ {
return Action::make('exportPdf') return Action::make('exportPdf')
->label('Export PDF') ->label(__('hr.actions.export_pdf'))
->icon('heroicon-o-document-arrow-down') ->icon('heroicon-o-document-arrow-down')
->action(fn (PdfExportService $pdf) => $pdf->employeeList( ->action(fn (PdfExportService $pdf) => $pdf->employeeList(
Employee::query()->with(['department', 'position', 'shift'])->orderBy('full_name')->get() Employee::query()->with(['department', 'position', 'shift'])->orderBy('full_name')->get()
@@ -41,7 +41,7 @@ class ExportPdfAction
public static function employeeListBulk(): BulkAction public static function employeeListBulk(): BulkAction
{ {
return BulkAction::make('exportPdf') return BulkAction::make('exportPdf')
->label('Export PDF') ->label(__('hr.actions.export_pdf'))
->icon('heroicon-o-document-arrow-down') ->icon('heroicon-o-document-arrow-down')
->action(fn (Collection $records, PdfExportService $pdf) => $pdf->employeeList( ->action(fn (Collection $records, PdfExportService $pdf) => $pdf->employeeList(
Employee::query() Employee::query()

View File

@@ -35,7 +35,7 @@ class HrForm
public static function leaveDaysDisplay(): TextInput public static function leaveDaysDisplay(): TextInput
{ {
return TextInput::make('days') return TextInput::make('days')
->label('Days') ->label(__('hr.fields.days'))
->numeric() ->numeric()
->disabled() ->disabled()
->dehydrated(false) ->dehydrated(false)

View File

@@ -9,10 +9,13 @@ use Filament\Widgets\ChartWidget;
class DepartmentDistributionChart extends ChartWidget class DepartmentDistributionChart extends ChartWidget
{ {
protected ?string $heading = 'Employees by Department';
protected int | string | array $columnSpan = 1; protected int | string | array $columnSpan = 1;
public function getHeading(): ?string
{
return __('hr.widgets.employees_by_department');
}
protected function getType(): string protected function getType(): string
{ {
return 'doughnut'; return 'doughnut';
@@ -28,7 +31,7 @@ class DepartmentDistributionChart extends ChartWidget
return [ return [
'datasets' => [ 'datasets' => [
[ [
'label' => 'Employees', 'label' => __('hr.widgets.employees'),
'data' => $departments->pluck('employees_count')->all(), 'data' => $departments->pluck('employees_count')->all(),
'backgroundColor' => [ 'backgroundColor' => [
'#3b82f6', '#3b82f6',

View File

@@ -14,7 +14,10 @@ use Filament\Widgets\StatsOverviewWidget\Stat;
class HrStatsOverviewWidget extends StatsOverviewWidget class HrStatsOverviewWidget extends StatsOverviewWidget
{ {
protected ?string $heading = 'HR Overview'; public function getHeading(): ?string
{
return __('hr.widgets.hr_overview');
}
protected function getStats(): array protected function getStats(): array
{ {
@@ -36,28 +39,28 @@ class HrStatsOverviewWidget extends StatsOverviewWidget
->count(); ->count();
return [ return [
Stat::make('Total Employees', Employee::query()->count()) Stat::make(__('hr.stats.total_employees'), Employee::query()->count())
->description('All employees in the system') ->description(__('hr.stats.total_employees_desc'))
->descriptionIcon('heroicon-o-users') ->descriptionIcon('heroicon-o-users')
->color('primary'), ->color('primary'),
Stat::make('Active', Employee::query()->where('employment_status', EmploymentStatus::Active)->count()) Stat::make(__('hr.stats.active'), Employee::query()->where('employment_status', EmploymentStatus::Active)->count())
->description('Currently active employees') ->description(__('hr.stats.active_desc'))
->descriptionIcon('heroicon-o-check-circle') ->descriptionIcon('heroicon-o-check-circle')
->color('success'), ->color('success'),
Stat::make('Inactive', Employee::query()->where('employment_status', EmploymentStatus::Inactive)->count()) Stat::make(__('hr.stats.inactive'), Employee::query()->where('employment_status', EmploymentStatus::Inactive)->count())
->description('Inactive employees') ->description(__('hr.stats.inactive_desc'))
->descriptionIcon('heroicon-o-pause-circle') ->descriptionIcon('heroicon-o-pause-circle')
->color('gray'), ->color('gray'),
Stat::make('On Vacation Today', $onVacationToday) Stat::make(__('hr.stats.on_vacation_today'), $onVacationToday)
->description('Approved vacations in progress') ->description(__('hr.stats.on_vacation_today_desc'))
->descriptionIcon('heroicon-o-sun') ->descriptionIcon('heroicon-o-sun')
->color('warning'), ->color('warning'),
Stat::make('On Sick Leave Today', $onSickLeaveToday) Stat::make(__('hr.stats.on_sick_leave_today'), $onSickLeaveToday)
->description('Employees on sick leave') ->description(__('hr.stats.on_sick_leave_today_desc'))
->descriptionIcon('heroicon-o-heart') ->descriptionIcon('heroicon-o-heart')
->color('danger'), ->color('danger'),
Stat::make('Pending Requests', $pendingRequests) Stat::make(__('hr.stats.pending_requests'), $pendingRequests)
->description('Vacation requests awaiting approval') ->description(__('hr.stats.pending_requests_desc'))
->descriptionIcon('heroicon-o-clock') ->descriptionIcon('heroicon-o-clock')
->color('info'), ->color('info'),
]; ];

View File

@@ -6,12 +6,16 @@ namespace App\Filament\Widgets;
use App\Models\Employee; use App\Models\Employee;
use Filament\Widgets\ChartWidget; use Filament\Widgets\ChartWidget;
class MonthlyHiringChart extends ChartWidget class MonthlyHiringChart extends ChartWidget
{ {
protected ?string $heading = 'Monthly Hiring (Last 12 Months)';
protected int | string | array $columnSpan = 1; protected int | string | array $columnSpan = 1;
public function getHeading(): ?string
{
return __('hr.widgets.monthly_hiring');
}
protected function getType(): string protected function getType(): string
{ {
return 'bar'; return 'bar';
@@ -35,7 +39,7 @@ class MonthlyHiringChart extends ChartWidget
return [ return [
'datasets' => [ 'datasets' => [
[ [
'label' => 'New Hires', 'label' => __('hr.widgets.new_hires'),
'data' => $data, 'data' => $data,
'backgroundColor' => '#3b82f6', 'backgroundColor' => '#3b82f6',
], ],

View File

@@ -10,10 +10,13 @@ use Filament\Widgets\ChartWidget;
class MonthlyLeaveChart extends ChartWidget class MonthlyLeaveChart extends ChartWidget
{ {
protected ?string $heading = 'Vacation Days by Month';
protected int | string | array $columnSpan = 1; protected int | string | array $columnSpan = 1;
public function getHeading(): ?string
{
return __('hr.widgets.vacation_days_by_month');
}
protected function getType(): string protected function getType(): string
{ {
return 'bar'; return 'bar';
@@ -37,7 +40,7 @@ class MonthlyLeaveChart extends ChartWidget
return [ return [
'datasets' => [ 'datasets' => [
[ [
'label' => 'Vacation Days', 'label' => __('hr.widgets.vacation_days'),
'data' => $data, 'data' => $data,
'backgroundColor' => '#f59e0b', 'backgroundColor' => '#f59e0b',
], ],

View File

@@ -13,10 +13,13 @@ use Illuminate\Database\Eloquent\Builder;
class RecentReportsWidget extends TableWidget class RecentReportsWidget extends TableWidget
{ {
protected static ?string $heading = 'Recent Disciplinary Reports';
protected int | string | array $columnSpan = 'full'; protected int | string | array $columnSpan = 'full';
public function getHeading(): ?string
{
return __('hr.widgets.recent_disciplinary_reports');
}
public function table(Table $table): Table public function table(Table $table): Table
{ {
return $table return $table
@@ -28,7 +31,7 @@ class RecentReportsWidget extends TableWidget
) )
->columns([ ->columns([
TextColumn::make('employee.full_name') TextColumn::make('employee.full_name')
->label('Employee'), ->label(__('hr.fields.employee')),
TextColumn::make('report_date') TextColumn::make('report_date')
->date(), ->date(),
TextColumn::make('title') TextColumn::make('title')
@@ -38,7 +41,7 @@ class RecentReportsWidget extends TableWidget
->color(fn (DisciplinarySeverity $state): string => $state->color()) ->color(fn (DisciplinarySeverity $state): string => $state->color())
->formatStateUsing(fn (DisciplinarySeverity $state): string => $state->label()), ->formatStateUsing(fn (DisciplinarySeverity $state): string => $state->label()),
TextColumn::make('creator.name') TextColumn::make('creator.name')
->label('Created By'), ->label(__('hr.fields.created_by')),
]) ])
->paginated(false); ->paginated(false);
} }

View File

@@ -11,10 +11,13 @@ use Filament\Widgets\TableWidget;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
class UpcomingBirthdaysWidget extends TableWidget class UpcomingBirthdaysWidget extends TableWidget
{ {
protected static ?string $heading = 'Upcoming Birthdays (30 Days)';
protected int | string | array $columnSpan = 1; protected int | string | array $columnSpan = 1;
public function getHeading(): ?string
{
return __('hr.widgets.upcoming_birthdays');
}
public function table(Table $table): Table public function table(Table $table): Table
{ {
return $table return $table
@@ -25,13 +28,13 @@ class UpcomingBirthdaysWidget extends TableWidget
) )
->columns([ ->columns([
TextColumn::make('full_name') TextColumn::make('full_name')
->label('Employee'), ->label(__('hr.fields.employee')),
TextColumn::make('birth_date') TextColumn::make('birth_date')
->label('Birthday') ->label(__('hr.fields.birthday'))
->date() ->date()
->formatStateUsing(fn (Employee $record): string => $record->birth_date?->format('M d') ?? '—'), ->formatStateUsing(fn (Employee $record): string => $record->birth_date?->format('M d') ?? '—'),
TextColumn::make('department.name') TextColumn::make('department.name')
->label('Department'), ->label(__('hr.fields.department')),
]) ])
->paginated(false); ->paginated(false);
} }

View File

@@ -13,10 +13,13 @@ use Illuminate\Database\Eloquent\Builder;
class UpcomingLeaveWidget extends TableWidget class UpcomingLeaveWidget extends TableWidget
{ {
protected static ?string $heading = 'Upcoming Approved Leave (14 Days)';
protected int | string | array $columnSpan = 1; protected int | string | array $columnSpan = 1;
public function getHeading(): ?string
{
return __('hr.widgets.upcoming_leave');
}
public function table(Table $table): Table public function table(Table $table): Table
{ {
return $table return $table
@@ -30,13 +33,13 @@ class UpcomingLeaveWidget extends TableWidget
) )
->columns([ ->columns([
TextColumn::make('employee.full_name') TextColumn::make('employee.full_name')
->label('Employee'), ->label(__('hr.fields.employee')),
TextColumn::make('start_date') TextColumn::make('start_date')
->date(), ->date(),
TextColumn::make('end_date') TextColumn::make('end_date')
->date(), ->date(),
TextColumn::make('days') TextColumn::make('days')
->label('Days'), ->label(__('hr.fields.days')),
]) ])
->paginated(false); ->paginated(false);
} }

View File

@@ -15,7 +15,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Spatie\Permission\Traits\HasRoles; use Spatie\Permission\Traits\HasRoles;
#[Fillable(['name', 'email', 'password', 'department_id'])] #[Fillable(['name', 'email', 'password', 'department_id', 'locale'])]
#[Hidden(['password', 'remember_token'])] #[Hidden(['password', 'remember_token'])]
class User extends Authenticatable implements FilamentUser class User extends Authenticatable implements FilamentUser
{ {

View File

@@ -31,11 +31,11 @@ class DisciplinaryReportCreatedNotification extends Notification implements Shou
$employee = $this->report->employee; $employee = $this->report->employee;
return (new MailMessage) return (new MailMessage)
->subject('New Disciplinary Report Created') ->subject(__('notifications.disciplinary_report_created.subject'))
->line("A new disciplinary report has been created for {$employee->full_name}.") ->line(__('notifications.disciplinary_report_created.line_created', ['name' => $employee->full_name]))
->line("Title: {$this->report->title}") ->line(__('notifications.disciplinary_report_created.title') . ': ' . $this->report->title)
->line("Severity: {$this->report->severity->label()}") ->line(__('notifications.disciplinary_report_created.severity') . ': ' . $this->report->severity->label())
->line("Date: {$this->report->report_date->toDateString()}"); ->line(__('notifications.disciplinary_report_created.date') . ': ' . $this->report->report_date->toDateString());
} }
/** /**

View File

@@ -29,9 +29,12 @@ class EmployeeTerminatedNotification extends Notification implements ShouldQueue
public function toMail(object $notifiable): MailMessage public function toMail(object $notifiable): MailMessage
{ {
return (new MailMessage) return (new MailMessage)
->subject('Employee Terminated') ->subject(__('notifications.employee_terminated.subject'))
->line("{$this->employee->full_name} ({$this->employee->employee_number}) has been terminated.") ->line(__('notifications.employee_terminated.line_terminated', [
->line("Termination date: {$this->employee->termination_date?->toDateString()}"); 'name' => $this->employee->full_name,
'number' => $this->employee->employee_number,
]))
->line(__('notifications.employee_terminated.termination_date') . ': ' . $this->employee->termination_date?->toDateString());
} }
/** /**

View File

@@ -31,11 +31,11 @@ class VacationApprovedNotification extends Notification implements ShouldQueue
$employee = $this->vacation->employee; $employee = $this->vacation->employee;
return (new MailMessage) return (new MailMessage)
->subject('Vacation Request Approved') ->subject(__('notifications.vacation_approved.subject'))
->line("The vacation request for {$employee->full_name} has been approved.") ->line(__('notifications.vacation_approved.line_approved', ['name' => $employee->full_name]))
->line("Type: {$this->vacation->type->label()}") ->line(__('notifications.vacation_approved.type') . ': ' . $this->vacation->type->label())
->line("Dates: {$this->vacation->start_date->toDateString()} to {$this->vacation->end_date->toDateString()}") ->line(__('notifications.vacation_approved.dates') . ': ' . $this->vacation->start_date->toDateString() . ' ' . $this->vacation->end_date->toDateString())
->line("Days: {$this->vacation->days}"); ->line(__('notifications.vacation_approved.days') . ': ' . $this->vacation->days);
} }
/** /**

View File

@@ -31,11 +31,11 @@ class VacationSubmittedNotification extends Notification implements ShouldQueue
$employee = $this->vacation->employee; $employee = $this->vacation->employee;
return (new MailMessage) return (new MailMessage)
->subject('New Vacation Request Submitted') ->subject(__('notifications.vacation_submitted.subject'))
->line("A new vacation request has been submitted for {$employee->full_name}.") ->line(__('notifications.vacation_submitted.line_submitted', ['name' => $employee->full_name]))
->line("Type: {$this->vacation->type->label()}") ->line(__('notifications.vacation_submitted.type') . ': ' . $this->vacation->type->label())
->line("Dates: {$this->vacation->start_date->toDateString()} to {$this->vacation->end_date->toDateString()}") ->line(__('notifications.vacation_submitted.dates') . ': ' . $this->vacation->start_date->toDateString() . ' ' . $this->vacation->end_date->toDateString())
->line("Days: {$this->vacation->days}"); ->line(__('notifications.vacation_submitted.days') . ': ' . $this->vacation->days);
} }
/** /**

View File

@@ -35,6 +35,9 @@ use App\Policies\SickLeavePolicy;
use App\Policies\UnpaidLeavePolicy; use App\Policies\UnpaidLeavePolicy;
use App\Policies\UserPolicy; use App\Policies\UserPolicy;
use App\Policies\VacationPolicy; use App\Policies\VacationPolicy;
use BezhanSalleh\LanguageSwitch\Events\LocaleChanged;
use BezhanSalleh\LanguageSwitch\LanguageSwitch;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
@@ -72,5 +75,17 @@ class AppServiceProvider extends ServiceProvider
UnpaidLeave::observe(UnpaidLeaveObserver::class); UnpaidLeave::observe(UnpaidLeaveObserver::class);
DisciplinaryReport::observe(DisciplinaryReportObserver::class); DisciplinaryReport::observe(DisciplinaryReportObserver::class);
EmployeeDocument::observe(EmployeeDocumentObserver::class); EmployeeDocument::observe(EmployeeDocumentObserver::class);
LanguageSwitch::configureUsing(function (LanguageSwitch $switch): void {
$switch
->locales(config('hr.supported_locales'))
->labels(config('hr.locale_labels'))
->displayLocale('native')
->userPreferredLocale(fn () => auth()->user()?->locale);
});
Event::listen(function (LocaleChanged $event): void {
auth()->user()?->update(['locale' => $event->locale]);
});
} }
} }

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Providers\Filament; namespace App\Providers\Filament;
use BezhanSalleh\FilamentShield\FilamentShieldPlugin; use BezhanSalleh\FilamentShield\FilamentShieldPlugin;
use App\Enums\NavigationGroup;
use App\Filament\Pages\Dashboard; use App\Filament\Pages\Dashboard;
use Filament\Http\Middleware\Authenticate; use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\AuthenticateSession; use Filament\Http\Middleware\AuthenticateSession;
@@ -28,19 +29,15 @@ class AdminPanelProvider extends PanelProvider
->default() ->default()
->id('admin') ->id('admin')
->path('admin') ->path('admin')
->viteTheme('resources/css/filament/admin/theme.css')
->login() ->login()
->brandName(config('hr.company_name')) ->brandName(config('hr.company_name'))
->viteTheme('resources/css/filament/admin/theme.css')
->colors([ ->colors([
'primary' => Color::Blue, 'primary' => Color::Blue,
'gray' => Color::Slate, 'gray' => Color::Slate,
]) ])
->navigationGroups([ ->navigationGroups(NavigationGroup::class)
'Organization',
'Employees',
'Leave Management',
'Records',
'System',
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\Filament\Resources') ->discoverResources(in: app_path('Filament/Resources'), for: 'App\Filament\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\Filament\Pages') ->discoverPages(in: app_path('Filament/Pages'), for: 'App\Filament\Pages')
->pages([ ->pages([
@@ -50,7 +47,7 @@ class AdminPanelProvider extends PanelProvider
->widgets([]) ->widgets([])
->plugins([ ->plugins([
FilamentShieldPlugin::make() FilamentShieldPlugin::make()
->navigationGroup('System'), ->navigationGroup(NavigationGroup::System),
]) ])
->middleware([ ->middleware([
EncryptCookies::class, EncryptCookies::class,

View File

@@ -8,6 +8,7 @@
"require": { "require": {
"php": "^8.3", "php": "^8.3",
"barryvdh/laravel-dompdf": "^3.1", "barryvdh/laravel-dompdf": "^3.1",
"bezhansalleh/filament-language-switch": "^5.0",
"bezhansalleh/filament-shield": "^4.3", "bezhansalleh/filament-shield": "^4.3",
"filament/filament": "^5.0", "filament/filament": "^5.0",
"laravel/framework": "^13.8", "laravel/framework": "^13.8",

89
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "f8edc238cb25b41635b830d1f8cb78f8", "content-hash": "be3c3ff78f2eaafd723ef2e5a6c235ca",
"packages": [ "packages": [
{ {
"name": "anourvalar/eloquent-serialize", "name": "anourvalar/eloquent-serialize",
@@ -148,6 +148,93 @@
], ],
"time": "2026-02-21T08:51:10+00:00" "time": "2026-02-21T08:51:10+00:00"
}, },
{
"name": "bezhansalleh/filament-language-switch",
"version": "5.0.0",
"source": {
"type": "git",
"url": "https://github.com/bezhanSalleh/filament-language-switch.git",
"reference": "737ed66c8c9a79e73e582980d77892e37713622a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bezhanSalleh/filament-language-switch/zipball/737ed66c8c9a79e73e582980d77892e37713622a",
"reference": "737ed66c8c9a79e73e582980d77892e37713622a",
"shasum": ""
},
"require": {
"filament/filament": "^4.0|^5.0",
"illuminate/contracts": "^11.28|^12.0|^13.0",
"illuminate/support": "^11.28|^12.0|^13.0",
"php": "^8.2",
"spatie/laravel-package-tools": "^1.9"
},
"require-dev": {
"larastan/larastan": "^3.0",
"laravel/pint": "^1.0",
"nunomaduro/collision": "^8.0",
"orchestra/testbench": "^9.0|^10.0|^11.0",
"pestphp/pest": "^3.8|^4.0",
"pestphp/pest-plugin-laravel": "^3.2|^4.0",
"pestphp/pest-plugin-livewire": "^3.0|^4.0",
"pestphp/pest-plugin-type-coverage": "^3.6|^4.0",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^11.0|^12.0",
"rector/jack": "^0.4.0",
"rector/rector": "^2.2",
"spatie/laravel-ray": "^1.43"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"BezhanSalleh\\LanguageSwitch\\LanguageSwitchServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"BezhanSalleh\\LanguageSwitch\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bezhan Salleh",
"email": "bezhan_salleh@yahoo.com",
"role": "Developer"
}
],
"description": "Zero config Language Switch(Changer/Localizer) plugin for filamentphp admin",
"homepage": "https://github.com/bezhansalleh/filament-language-switch",
"keywords": [
"bezhanSalleh",
"filament-language-changer",
"filament-language-switch",
"filament-locale-changer",
"filament-localizer",
"filament-plugin",
"filamentphp",
"laravel"
],
"support": {
"issues": "https://github.com/bezhanSalleh/filament-language-switch/issues",
"source": "https://github.com/bezhanSalleh/filament-language-switch/tree/5.0.0"
},
"funding": [
{
"url": "https://github.com/bezhanSalleh",
"type": "github"
}
],
"time": "2026-06-27T23:33:56+00:00"
},
{ {
"name": "bezhansalleh/filament-plugin-essentials", "name": "bezhansalleh/filament-plugin-essentials",
"version": "1.3.0", "version": "1.3.0",

View File

@@ -17,4 +17,14 @@ return [
'directory' => 'hr', 'directory' => 'hr',
], ],
'supported_locales' => ['en', 'tk', 'ru'],
'default_locale' => 'en',
'locale_labels' => [
'en' => 'English',
'tk' => 'Türkmen',
'ru' => 'Русский',
],
]; ];

View File

@@ -34,6 +34,7 @@ class UserFactory extends Factory
'password' => static::$password ??= Hash::make('password'), 'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10), 'remember_token' => Str::random(10),
'department_id' => Department::factory(), 'department_id' => Department::factory(),
'locale' => 'en',
]; ];
} }

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->string('locale', 5)->default('en')->after('email');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('locale');
});
}
};

View File

@@ -15,7 +15,7 @@ class AdminUserSeeder extends Seeder
public function run(): void public function run(): void
{ {
$admin = User::query()->updateOrCreate( $admin = User::query()->updateOrCreate(
['email' => 'admin@company.com'], ['email' => 'admin@example.com'],
[ [
'name' => 'Admin', 'name' => 'Admin',
'password' => Hash::make('password'), 'password' => Hash::make('password'),

59
lang/en/enums.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
return [
'gender' => [
'male' => 'Male',
'female' => 'Female',
'other' => 'Other',
],
'employment_status' => [
'active' => 'Active',
'inactive' => 'Inactive',
'terminated' => 'Terminated',
'on_leave' => 'On Leave',
],
'vacation_type' => [
'annual' => 'Annual',
'marriage' => 'Marriage',
'study' => 'Study',
'other' => 'Other',
],
'approval_status' => [
'pending' => 'Pending',
'approved' => 'Approved',
'rejected' => 'Rejected',
],
'document_type' => [
'passport' => 'Passport',
'contract' => 'Contract',
'medical_certificate' => 'Medical Certificate',
'education_certificate' => 'Education Certificate',
'other' => 'Other',
],
'bonus_type' => [
'performance' => 'Performance',
'holiday' => 'Holiday',
'retention' => 'Retention',
'other' => 'Other',
],
'disciplinary_severity' => [
'low' => 'Low',
'medium' => 'Medium',
'high' => 'High',
],
'import_type' => [
'employees' => 'Employees',
'vacations' => 'Vacations',
'bonuses' => 'Bonuses',
'reports' => 'Disciplinary Reports',
],
];

51
lang/en/exports.php Normal file
View File

@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
return [
'employee_list' => [
'title' => 'Employee List',
'heading' => 'Employee Directory',
'generated' => 'Generated',
'number' => '#',
'name' => 'Name',
'department' => 'Department',
'position' => 'Position',
'shift' => 'Shift',
'status' => 'Status',
'phone' => 'Phone',
],
'employee_profile' => [
'title' => 'Employee Profile — :name',
'department' => 'Department',
'position' => 'Position',
'shift' => 'Shift',
'status' => 'Status',
'phone' => 'Phone',
'hire_date' => 'Hire Date',
'termination' => 'Termination',
'vacation_taken' => 'Vacation Taken',
'remaining' => 'Remaining',
'sick_leaves' => 'Sick Leaves',
'reports' => 'Reports',
],
'leave_summary' => [
'title' => 'Leave Summary — :name',
'heading' => 'Leave Summary',
'annual_taken' => 'Annual taken',
'remaining' => 'Remaining',
'sick_leaves' => 'Sick leaves',
'vacations' => 'Vacations',
'sick_leaves_heading' => 'Sick Leaves',
'start' => 'Start',
'end' => 'End',
'days' => 'Days',
'type' => 'Type',
'status' => 'Status',
'institution' => 'Institution',
'no_vacation_records' => 'No vacation records.',
'no_sick_leave_records' => 'No sick leave records.',
],
];

248
lang/en/hr.php Normal file
View File

@@ -0,0 +1,248 @@
<?php
declare(strict_types=1);
return [
'navigation' => [
'organization' => 'Organization',
'employees' => 'Employees',
'leave_management' => 'Leave Management',
'records' => 'Records',
'system' => 'System',
],
'resources' => [
'audit_log' => 'Audit Log',
'activity_log' => 'Activity Log',
'activity_logs' => 'Activity Logs',
'import_wizard' => 'Import Wizard',
'department' => 'Department',
'departments' => 'Departments',
'position' => 'Position',
'positions' => 'Positions',
'shift' => 'Shift',
'shifts' => 'Shifts',
'employee' => 'Employee',
'employees' => 'Employees',
'vacation' => 'Vacation',
'vacations' => 'Vacations',
'sick_leave' => 'Sick Leave',
'sick_leaves' => 'Sick Leaves',
'unpaid_leave' => 'Unpaid Leave',
'unpaid_leaves' => 'Unpaid Leaves',
'disciplinary_report' => 'Disciplinary Report',
'disciplinary_reports' => 'Disciplinary Reports',
'explanation' => 'Explanation',
'explanations' => 'Explanations',
'bonus' => 'Bonus',
'bonuses' => 'Bonuses',
'gift' => 'Gift',
'gifts' => 'Gifts',
'employee_document' => 'Employee Document',
'employee_documents' => 'Employee Documents',
'user' => 'User',
'users' => 'Users',
],
'fields' => [
'photo' => 'Photo',
'employee_number' => 'Employee Number',
'full_name' => 'Full Name',
'national_id' => 'National ID',
'gender' => 'Gender',
'birth_date' => 'Birth Date',
'phone' => 'Phone',
'address' => 'Address',
'department' => 'Department',
'department_for_managers' => 'Department (for managers)',
'position' => 'Position',
'shift' => 'Shift',
'employment_status' => 'Employment Status',
'status' => 'Status',
'hire_date' => 'Hire Date',
'termination_date' => 'Termination Date',
'notes' => 'Notes',
'email_address' => 'Email address',
'locale' => 'Language',
'number' => 'Number',
'name' => 'Name',
'employee' => 'Employee',
'type' => 'Type',
'attachment' => 'Attachment',
'document' => 'Document',
'medical_document' => 'Medical Document',
'return_date' => 'Return Date',
'approved_by' => 'Approved By',
'created_by' => 'Created By',
'gift_name' => 'Gift Name',
'gift' => 'Gift',
'active' => 'Active',
'starts_at' => 'Starts at',
'ends_at' => 'Ends at',
'starts' => 'Starts',
'ends' => 'Ends',
'days' => 'Days',
'birthday' => 'Birthday',
'download' => 'Download',
'date' => 'Date',
'subject_type' => 'Subject Type',
'subject_id' => 'Subject ID',
'causer' => 'Causer',
'log_name' => 'Log Name',
'changes' => 'Changes',
'previous_values' => 'Previous Values',
'date_range' => 'Date Range',
'start_from' => 'Start from',
'start_until' => 'Start until',
'from' => 'From',
'until' => 'Until',
'tenure' => 'Tenure',
'vacation_taken_days' => 'Vacation Taken (days)',
'vacation_remaining_days' => 'Vacation Remaining (days)',
'sick_leave_records' => 'Sick Leave Records',
'disciplinary_reports' => 'Disciplinary Reports',
'total_bonuses' => 'Total Bonuses',
'gifts_received' => 'Gifts Received',
'days_taken' => 'Days Taken',
'days_remaining' => 'Days Remaining',
'annual_allowance' => 'Annual Allowance',
'scheduled_vacations' => 'Scheduled Vacations',
'unpaid_leave_records' => 'Unpaid Leave Records',
'explanations' => 'Explanations',
'title' => 'Title',
'description' => 'Description',
'severity' => 'Severity',
'amount' => 'Amount',
'reason' => 'Reason',
'bonus_date' => 'Bonus Date',
'bonus_type' => 'Bonus Type',
'report_date' => 'Report Date',
'start_date' => 'Start Date',
'end_date' => 'End Date',
'institution' => 'Institution',
],
'tabs' => [
'personal' => 'Personal',
'employment' => 'Employment',
'employee' => 'Employee',
],
'sections' => [
'employee_details' => 'Employee Details',
'overview' => 'Overview',
'profile' => 'Profile',
'employment_timeline' => 'Employment Timeline',
'statistics' => 'Statistics',
'leave_attendance' => 'Leave & Attendance',
'hr_records' => 'HR Records',
'leave_summary' => 'Leave Summary',
'annual_leave_balance' => 'Annual Leave Balance',
'upcoming_approved_leave' => 'Upcoming Approved Leave',
'other_leave_types' => 'Other Leave Types',
'activity_details' => 'Activity Details',
],
'messages' => [
'no_upcoming_approved_leave' => 'No upcoming approved leave',
'days_suffix' => 'days',
],
'filters' => [
'all_shifts' => 'All shifts',
'all_departments' => 'All departments',
],
'audit' => [
'employee' => 'Employee',
'vacation' => 'Vacation',
'bonus' => 'Bonus',
'disciplinary_report' => 'Disciplinary Report',
'department' => 'Department',
'user' => 'User',
],
'widgets' => [
'hr_overview' => 'HR Overview',
'upcoming_birthdays' => 'Upcoming Birthdays (30 Days)',
'upcoming_leave' => 'Upcoming Approved Leave (14 Days)',
'recent_disciplinary_reports' => 'Recent Disciplinary Reports',
'monthly_hiring' => 'Monthly Hiring (Last 12 Months)',
'vacation_days_by_month' => 'Vacation Days by Month',
'employees_by_department' => 'Employees by Department',
'new_hires' => 'New Hires',
'vacation_days' => 'Vacation Days',
'employees' => 'Employees',
],
'stats' => [
'total_employees' => 'Total Employees',
'total_employees_desc' => 'All employees in the system',
'active' => 'Active',
'active_desc' => 'Currently active employees',
'inactive' => 'Inactive',
'inactive_desc' => 'Inactive employees',
'on_vacation_today' => 'On Vacation Today',
'on_vacation_today_desc' => 'Approved vacations in progress',
'on_sick_leave_today' => 'On Sick Leave Today',
'on_sick_leave_today_desc' => 'Employees on sick leave',
'pending_requests' => 'Pending Requests',
'pending_requests_desc' => 'Vacation requests awaiting approval',
],
'actions' => [
'export' => 'Export',
'export_selected' => 'Export Selected',
'export_pdf' => 'Export PDF',
'leave_summary_pdf' => 'Leave Summary PDF',
'approve' => 'Approve',
'reject' => 'Reject',
'change_department' => 'Change Department',
'download' => 'Download',
],
'relation_managers' => [
'sick_leaves' => 'Sick Leaves',
'vacations' => 'Vacations',
'unpaid_leaves' => 'Unpaid Leaves',
'disciplinary_reports' => 'Disciplinary Reports',
'explanations' => 'Explanations',
'bonuses' => 'Bonuses',
'gifts' => 'Gifts',
'employee_documents' => 'Employee Documents',
],
'import' => [
'title' => 'Import Wizard',
'import_type' => 'Import Type',
'excel_file' => 'Excel File',
'preview' => 'Preview',
'import_results' => 'Import Results',
'start_import' => 'Start Import',
'upload' => 'Upload',
'upload_description' => 'Select import type and upload an Excel file',
'map_columns' => 'Map Columns',
'map_columns_description' => 'Match spreadsheet columns to system fields',
'column_mapping' => 'Column Mapping',
'preview_step' => 'Preview',
'preview_description' => 'Review the first 10 rows with validation',
'import_step' => 'Import',
'import_description' => 'Run the import and review results',
'upload_required_title' => 'Upload required',
'upload_required_body' => 'Please upload an Excel file before importing.',
'import_queued_title' => 'Import queued',
'import_queued_body' => 'Your import has been queued and will be processed shortly.',
'mapping_hint' => 'Upload a file in step 1 to load column headers.',
'upload_to_preview' => 'Upload a file to preview rows.',
'no_rows' => 'No rows found in the uploaded file.',
'submit_to_see_results' => 'Submit the import to see results here after processing completes.',
'row' => 'Row',
'validation' => 'Validation',
'valid' => 'Valid',
'total_rows' => 'Total rows',
'imported' => 'Imported',
'skipped_duplicates' => 'Skipped (duplicates)',
'failed' => 'Failed',
'errors' => 'Errors',
],
];

35
lang/en/notifications.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
return [
'vacation_approved' => [
'subject' => 'Vacation Request Approved',
'line_approved' => 'The vacation request for :name has been approved.',
'type' => 'Type',
'dates' => 'Dates',
'days' => 'Days',
],
'vacation_submitted' => [
'subject' => 'New Vacation Request Submitted',
'line_submitted' => 'A new vacation request has been submitted for :name.',
'type' => 'Type',
'dates' => 'Dates',
'days' => 'Days',
],
'disciplinary_report_created' => [
'subject' => 'New Disciplinary Report Created',
'line_created' => 'A new disciplinary report has been created for :name.',
'title' => 'Title',
'severity' => 'Severity',
'date' => 'Date',
],
'employee_terminated' => [
'subject' => 'Employee Terminated',
'line_terminated' => ':name (:number) has been terminated.',
'termination_date' => 'Termination date',
],
];

59
lang/ru/enums.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
return [
'gender' => [
'male' => 'Мужской',
'female' => 'Женский',
'other' => 'Другой',
],
'employment_status' => [
'active' => 'Активный',
'inactive' => 'Неактивный',
'terminated' => 'Уволен',
'on_leave' => 'В отпуске',
],
'vacation_type' => [
'annual' => 'Ежегодный',
'marriage' => 'Свадебный',
'study' => 'Учебный',
'other' => 'Другой',
],
'approval_status' => [
'pending' => 'Ожидает',
'approved' => 'Одобрено',
'rejected' => 'Отклонено',
],
'document_type' => [
'passport' => 'Паспорт',
'contract' => 'Договор',
'medical_certificate' => 'Медицинская справка',
'education_certificate' => 'Сертификат об образовании',
'other' => 'Другое',
],
'bonus_type' => [
'performance' => 'За результат',
'holiday' => 'Праздничная',
'retention' => 'Удержание',
'other' => 'Другая',
],
'disciplinary_severity' => [
'low' => 'Низкая',
'medium' => 'Средняя',
'high' => 'Высокая',
],
'import_type' => [
'employees' => 'Сотрудники',
'vacations' => 'Отпуска',
'bonuses' => 'Премии',
'reports' => 'Дисциплинарные отчёты',
],
];

51
lang/ru/exports.php Normal file
View File

@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
return [
'employee_list' => [
'title' => 'Список сотрудников',
'heading' => 'Справочник сотрудников',
'generated' => 'Создано',
'number' => '#',
'name' => 'Имя',
'department' => 'Отдел',
'position' => 'Должность',
'shift' => 'Смена',
'status' => 'Статус',
'phone' => 'Телефон',
],
'employee_profile' => [
'title' => 'Профиль сотрудника — :name',
'department' => 'Отдел',
'position' => 'Должность',
'shift' => 'Смена',
'status' => 'Статус',
'phone' => 'Телефон',
'hire_date' => 'Дата приёма',
'termination' => 'Увольнение',
'vacation_taken' => 'Использовано отпуска',
'remaining' => 'Остаток',
'sick_leaves' => 'Больничные',
'reports' => 'Отчёты',
],
'leave_summary' => [
'title' => 'Сводка отпусков — :name',
'heading' => 'Сводка отпусков',
'annual_taken' => 'Использовано годовых',
'remaining' => 'Остаток',
'sick_leaves' => 'Больничные',
'vacations' => 'Отпуска',
'sick_leaves_heading' => 'Больничные',
'start' => 'Начало',
'end' => 'Конец',
'days' => 'Дней',
'type' => 'Тип',
'status' => 'Статус',
'institution' => 'Учреждение',
'no_vacation_records' => 'Записей об отпусках нет.',
'no_sick_leave_records' => 'Записей о больничных нет.',
],
];

248
lang/ru/hr.php Normal file
View File

@@ -0,0 +1,248 @@
<?php
declare(strict_types=1);
return [
'navigation' => [
'organization' => 'Организация',
'employees' => 'Сотрудники',
'leave_management' => 'Управление отпусками',
'records' => 'Записи',
'system' => 'Система',
],
'resources' => [
'audit_log' => 'Журнал аудита',
'activity_log' => 'Журнал активности',
'activity_logs' => 'Журналы активности',
'import_wizard' => 'Мастер импорта',
'department' => 'Отдел',
'departments' => 'Отделы',
'position' => 'Должность',
'positions' => 'Должности',
'shift' => 'Смена',
'shifts' => 'Смены',
'employee' => 'Сотрудник',
'employees' => 'Сотрудники',
'vacation' => 'Отпуск',
'vacations' => 'Отпуска',
'sick_leave' => 'Больничный',
'sick_leaves' => 'Больничные',
'unpaid_leave' => 'Неоплачиваемый отпуск',
'unpaid_leaves' => 'Неоплачиваемые отпуска',
'disciplinary_report' => 'Дисциплинарный отчёт',
'disciplinary_reports' => 'Дисциплинарные отчёты',
'explanation' => 'Объяснительная',
'explanations' => 'Объяснительные',
'bonus' => 'Премия',
'bonuses' => 'Премии',
'gift' => 'Подарок',
'gifts' => 'Подарки',
'employee_document' => 'Документ сотрудника',
'employee_documents' => 'Документы сотрудников',
'user' => 'Пользователь',
'users' => 'Пользователи',
],
'fields' => [
'photo' => 'Фото',
'employee_number' => 'Табельный номер',
'full_name' => 'ФИО',
'national_id' => 'Национальный ID',
'gender' => 'Пол',
'birth_date' => 'Дата рождения',
'phone' => 'Телефон',
'address' => 'Адрес',
'department' => 'Отдел',
'department_for_managers' => 'Отдел (для менеджеров)',
'position' => 'Должность',
'shift' => 'Смена',
'employment_status' => 'Статус занятости',
'status' => 'Статус',
'hire_date' => 'Дата приёма',
'termination_date' => 'Дата увольнения',
'notes' => 'Примечания',
'email_address' => 'Email',
'locale' => 'Язык',
'number' => 'Номер',
'name' => 'Имя',
'employee' => 'Сотрудник',
'type' => 'Тип',
'attachment' => 'Вложение',
'document' => 'Документ',
'medical_document' => 'Медицинский документ',
'return_date' => 'Дата возвращения',
'approved_by' => 'Утвердил',
'created_by' => 'Создал',
'gift_name' => 'Название подарка',
'gift' => 'Подарок',
'active' => 'Активен',
'starts_at' => 'Начало',
'ends_at' => 'Конец',
'starts' => 'Начало',
'ends' => 'Конец',
'days' => 'Дней',
'birthday' => 'День рождения',
'download' => 'Скачать',
'date' => 'Дата',
'subject_type' => 'Тип объекта',
'subject_id' => 'ID объекта',
'causer' => 'Инициатор',
'log_name' => 'Имя журнала',
'changes' => 'Изменения',
'previous_values' => 'Предыдущие значения',
'date_range' => 'Диапазон дат',
'start_from' => 'Начало с',
'start_until' => 'Начало до',
'from' => 'С',
'until' => 'До',
'tenure' => 'Стаж',
'vacation_taken_days' => 'Использовано отпуска (дней)',
'vacation_remaining_days' => 'Остаток отпуска (дней)',
'sick_leave_records' => 'Записи о больничных',
'disciplinary_reports' => 'Дисциплинарные отчёты',
'total_bonuses' => 'Всего премий',
'gifts_received' => 'Получено подарков',
'days_taken' => 'Использовано дней',
'days_remaining' => 'Осталось дней',
'annual_allowance' => 'Годовая норма',
'scheduled_vacations' => 'Запланированные отпуска',
'unpaid_leave_records' => 'Записи неоплачиваемого отпуска',
'explanations' => 'Объяснительные',
'title' => 'Заголовок',
'description' => 'Описание',
'severity' => 'Серьёзность',
'amount' => 'Сумма',
'reason' => 'Причина',
'bonus_date' => 'Дата премии',
'bonus_type' => 'Тип премии',
'report_date' => 'Дата отчёта',
'start_date' => 'Дата начала',
'end_date' => 'Дата окончания',
'institution' => 'Учреждение',
],
'tabs' => [
'personal' => 'Личные данные',
'employment' => 'Трудоустройство',
'employee' => 'Сотрудник',
],
'sections' => [
'employee_details' => 'Данные сотрудника',
'overview' => 'Обзор',
'profile' => 'Профиль',
'employment_timeline' => 'История трудоустройства',
'statistics' => 'Статистика',
'leave_attendance' => 'Отпуска и посещаемость',
'hr_records' => 'HR записи',
'leave_summary' => 'Сводка отпусков',
'annual_leave_balance' => 'Баланс ежегодного отпуска',
'upcoming_approved_leave' => 'Предстоящий одобренный отпуск',
'other_leave_types' => 'Другие типы отпусков',
'activity_details' => 'Детали активности',
],
'messages' => [
'no_upcoming_approved_leave' => 'Нет предстоящих одобренных отпусков',
'days_suffix' => 'дней',
],
'filters' => [
'all_shifts' => 'Все смены',
'all_departments' => 'Все отделы',
],
'audit' => [
'employee' => 'Сотрудник',
'vacation' => 'Отпуск',
'bonus' => 'Премия',
'disciplinary_report' => 'Дисциплинарный отчёт',
'department' => 'Отдел',
'user' => 'Пользователь',
],
'widgets' => [
'hr_overview' => 'Обзор HR',
'upcoming_birthdays' => 'Предстоящие дни рождения (30 дней)',
'upcoming_leave' => 'Предстоящий одобренный отпуск (14 дней)',
'recent_disciplinary_reports' => 'Недавние дисциплинарные отчёты',
'monthly_hiring' => 'Ежемесячный найм (последние 12 месяцев)',
'vacation_days_by_month' => 'Дни отпуска по месяцам',
'employees_by_department' => 'Сотрудники по отделам',
'new_hires' => 'Новые сотрудники',
'vacation_days' => 'Дни отпуска',
'employees' => 'Сотрудники',
],
'stats' => [
'total_employees' => 'Всего сотрудников',
'total_employees_desc' => 'Все сотрудники в системе',
'active' => 'Активные',
'active_desc' => 'Сейчас активные сотрудники',
'inactive' => 'Неактивные',
'inactive_desc' => 'Неактивные сотрудники',
'on_vacation_today' => 'В отпуске сегодня',
'on_vacation_today_desc' => 'Одобренные отпуска в процессе',
'on_sick_leave_today' => 'На больничном сегодня',
'on_sick_leave_today_desc' => 'Сотрудники на больничном',
'pending_requests' => 'Ожидающие запросы',
'pending_requests_desc' => 'Запросы на отпуск, ожидающие одобрения',
],
'actions' => [
'export' => 'Экспорт',
'export_selected' => 'Экспорт выбранного',
'export_pdf' => 'Экспорт PDF',
'leave_summary_pdf' => 'PDF сводки отпусков',
'approve' => 'Одобрить',
'reject' => 'Отклонить',
'change_department' => 'Изменить отдел',
'download' => 'Скачать',
],
'relation_managers' => [
'sick_leaves' => 'Больничные',
'vacations' => 'Отпуска',
'unpaid_leaves' => 'Неоплачиваемые отпуска',
'disciplinary_reports' => 'Дисциплинарные отчёты',
'explanations' => 'Объяснительные',
'bonuses' => 'Премии',
'gifts' => 'Подарки',
'employee_documents' => 'Документы сотрудников',
],
'import' => [
'title' => 'Мастер импорта',
'import_type' => 'Тип импорта',
'excel_file' => 'Файл Excel',
'preview' => 'Предпросмотр',
'import_results' => 'Результаты импорта',
'start_import' => 'Начать импорт',
'upload' => 'Загрузка',
'upload_description' => 'Выберите тип импорта и загрузите файл Excel',
'map_columns' => 'Сопоставление столбцов',
'map_columns_description' => 'Сопоставьте столбцы таблицы с полями системы',
'column_mapping' => 'Сопоставление столбцов',
'preview_step' => 'Предпросмотр',
'preview_description' => 'Просмотрите первые 10 строк с проверкой',
'import_step' => 'Импорт',
'import_description' => 'Запустите импорт и просмотрите результаты',
'upload_required_title' => 'Требуется загрузка',
'upload_required_body' => 'Пожалуйста, загрузите файл Excel перед импортом.',
'import_queued_title' => 'Импорт поставлен в очередь',
'import_queued_body' => 'Ваш импорт поставлен в очередь и будет обработан в ближайшее время.',
'mapping_hint' => 'Загрузите файл на шаге 1 для загрузки заголовков столбцов.',
'upload_to_preview' => 'Загрузите файл для предпросмотра строк.',
'no_rows' => 'В загруженном файле строк не найдено.',
'submit_to_see_results' => 'Отправьте импорт, чтобы увидеть результаты после обработки.',
'row' => 'Строка',
'validation' => 'Проверка',
'valid' => 'Действительно',
'total_rows' => 'Всего строк',
'imported' => 'Импортировано',
'skipped_duplicates' => 'Пропущено (дубликаты)',
'failed' => 'Ошибки',
'errors' => 'Ошибки',
],
];

35
lang/ru/notifications.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
return [
'vacation_approved' => [
'subject' => 'Запрос на отпуск одобрен',
'line_approved' => 'Запрос на отпуск для :name одобрен.',
'type' => 'Тип',
'dates' => 'Даты',
'days' => 'Дней',
],
'vacation_submitted' => [
'subject' => 'Новый запрос на отпуск',
'line_submitted' => 'Новый запрос на отпуск отправлен для :name.',
'type' => 'Тип',
'dates' => 'Даты',
'days' => 'Дней',
],
'disciplinary_report_created' => [
'subject' => 'Создан новый дисциплинарный отчёт',
'line_created' => 'Новый дисциплинарный отчёт создан для :name.',
'title' => 'Заголовок',
'severity' => 'Серьёзность',
'date' => 'Дата',
],
'employee_terminated' => [
'subject' => 'Сотрудник уволен',
'line_terminated' => ':name (:number) уволен.',
'termination_date' => 'Дата увольнения',
],
];

59
lang/tk/enums.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
return [
'gender' => [
'male' => 'Erkek',
'female' => 'Aýal',
'other' => 'Beýleki',
],
'employment_status' => [
'active' => 'Işjeň',
'inactive' => 'Işjeň däl',
'terminated' => 'Işden boşadyldy',
'on_leave' => 'Rugsatda',
],
'vacation_type' => [
'annual' => 'Ýyllyk',
'marriage' => 'Toý',
'study' => 'Okuw',
'other' => 'Beýleki',
],
'approval_status' => [
'pending' => 'Garaşylýar',
'approved' => 'Tassyklandy',
'rejected' => 'Ret edildi',
],
'document_type' => [
'passport' => 'Pasport',
'contract' => 'Şertnama',
'medical_certificate' => 'Lukmançylyk kepilnamasy',
'education_certificate' => 'Bilim kepilnamasy',
'other' => 'Beýleki',
],
'bonus_type' => [
'performance' => 'Netije',
'holiday' => 'Baýramçylyk',
'retention' => 'Saklamak',
'other' => 'Beýleki',
],
'disciplinary_severity' => [
'low' => 'Pes',
'medium' => 'Orta',
'high' => 'Ýokary',
],
'import_type' => [
'employees' => 'Işgärler',
'vacations' => 'Dynç alyşlar',
'bonuses' => 'Baýraklar',
'reports' => 'Terbiýe hasabatlary',
],
];

Some files were not shown because too many files have changed in this diff Show More