Add labels for various fields across HR resources to improve localization and user experience.

This commit is contained in:
Mekan1206
2026-08-02 20:10:48 +05:00
parent 8147f23750
commit e3ec83686c
52 changed files with 363 additions and 26 deletions

View File

@@ -29,26 +29,32 @@ class EmployeeForm
->avatar()
->imageEditor(),
TextInput::make('employee_number')
->label(__('hr.fields.employee_number'))
->required()
->maxLength(50)
->unique(ignoreRecord: true),
TextInput::make('full_name')
->label(__('hr.fields.full_name'))
->required()
->maxLength(255),
TextInput::make('national_id')
->label(__('hr.fields.national_id'))
->maxLength(50),
Select::make('gender')
->label(__('hr.fields.gender'))
->options(Gender::class)
->required()
->native(false),
DatePicker::make('birth_date')
->label(__('hr.fields.birth_date'))
->required(),
TextInput::make('phone')
->label(__('hr.fields.phone'))
->tel()
->default(config('hr.default_phone'))
->required(),
Textarea::make('address')
->label(__('hr.fields.address'))
->rows(3)
->columnSpanFull(),
])
@@ -56,29 +62,36 @@ class EmployeeForm
Tab::make(__('hr.tabs.employment'))
->schema([
Select::make('department_id')
->label(__('hr.fields.department'))
->relationship('department', 'name')
->searchable()
->preload()
->required(),
Select::make('position_id')
->label(__('hr.fields.position'))
->relationship('position', 'name')
->searchable()
->preload()
->required(),
Select::make('shift_id')
->label(__('hr.fields.shift'))
->relationship('shift', 'name')
->searchable()
->preload()
->required(),
Select::make('employment_status')
->label(__('hr.fields.employment_status'))
->options(EmploymentStatus::class)
->default(EmploymentStatus::Active)
->required()
->native(false),
DatePicker::make('hire_date')
->label(__('hr.fields.hire_date'))
->required(),
DatePicker::make('termination_date'),
DatePicker::make('termination_date')
->label(__('hr.fields.termination_date')),
Textarea::make('notes')
->label(__('hr.fields.notes'))
->rows(4)
->columnSpanFull(),
])

View File

@@ -38,18 +38,23 @@ class EmployeeInfolist
->columnSpanFull(),
TextEntry::make('employee_number')
->label(__('hr.fields.employee_number')),
TextEntry::make('full_name'),
TextEntry::make('full_name')
->label(__('hr.fields.full_name')),
TextEntry::make('national_id')
->label(__('hr.fields.national_id'))
->placeholder('—'),
TextEntry::make('gender')
->label(__('hr.fields.gender'))
->badge()
->color(fn (Gender $state): string => $state->color())
->formatStateUsing(fn (Gender $state): string => $state->label()),
TextEntry::make('birth_date')
->label(__('hr.fields.birth_date'))
->date(),
TextEntry::make('phone'),
TextEntry::make('phone')
->label(__('hr.fields.phone')),
TextEntry::make('address')
->label(__('hr.fields.address'))
->placeholder('—')
->columnSpanFull(),
])
@@ -69,6 +74,7 @@ class EmployeeInfolist
->badge()
->color('gray'),
TextEntry::make('employment_status')
->label(__('hr.fields.employment_status'))
->badge()
->color(fn (EmploymentStatus $state): string => $state->color())
->formatStateUsing(fn (EmploymentStatus $state): string => $state->label())
@@ -92,6 +98,7 @@ class EmployeeInfolist
? $record->hire_date->diffForHumans(now(), true)
: '—'),
TextEntry::make('notes')
->label(__('hr.fields.notes'))
->placeholder('—')
->columnSpanFull(),
])