Add labels for various fields across HR resources to improve localization and user experience.
This commit is contained in:
@@ -29,9 +29,11 @@ class ActivityLogsTable
|
||||
->dateTime()
|
||||
->sortable(),
|
||||
TextColumn::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->searchable()
|
||||
->limit(50),
|
||||
TextColumn::make('event')
|
||||
->label(__('hr.fields.event'))
|
||||
->badge()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
@@ -48,6 +50,7 @@ class ActivityLogsTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('log_name')
|
||||
->label(__('hr.fields.log_name'))
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->defaultSort('created_at', 'desc')
|
||||
@@ -63,6 +66,7 @@ class ActivityLogsTable
|
||||
User::class => __('hr.audit.user'),
|
||||
]),
|
||||
SelectFilter::make('event')
|
||||
->label(__('hr.fields.event'))
|
||||
->options(fn (): array => \Spatie\Activitylog\Models\Activity::query()
|
||||
->whereNotNull('event')
|
||||
->distinct()
|
||||
@@ -74,6 +78,7 @@ class ActivityLogsTable
|
||||
->searchable()
|
||||
->preload(),
|
||||
Filter::make('created_at')
|
||||
->label(__('hr.fields.date'))
|
||||
->schema([
|
||||
DatePicker::make('from')
|
||||
->label(__('hr.fields.from')),
|
||||
|
||||
@@ -18,19 +18,23 @@ class BonusForm
|
||||
->components([
|
||||
HrForm::employeeSelect(),
|
||||
DatePicker::make('bonus_date')
|
||||
->label(__('hr.fields.bonus_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
Select::make('bonus_type')
|
||||
->label(__('hr.fields.bonus_type'))
|
||||
->options(BonusType::class)
|
||||
->required()
|
||||
->native(false),
|
||||
TextInput::make('amount')
|
||||
->label(__('hr.fields.amount'))
|
||||
->required()
|
||||
->numeric()
|
||||
->prefix('TMT')
|
||||
->minValue(0)
|
||||
->step(0.01),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
|
||||
@@ -15,21 +15,28 @@ class BonusInfolist
|
||||
TextEntry::make('employee.id')
|
||||
->label(__('hr.fields.employee')),
|
||||
TextEntry::make('bonus_date')
|
||||
->label(__('hr.fields.bonus_date'))
|
||||
->date(),
|
||||
TextEntry::make('bonus_type')
|
||||
->label(__('hr.fields.bonus_type'))
|
||||
->badge(),
|
||||
TextEntry::make('amount')
|
||||
->label(__('hr.fields.amount'))
|
||||
->numeric(),
|
||||
TextEntry::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (Bonus $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -26,6 +26,7 @@ class BonusesTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('bonus_date')
|
||||
->label(__('hr.fields.bonus_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('bonus_type')
|
||||
@@ -36,20 +37,25 @@ class BonusesTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('amount')
|
||||
->label(__('hr.fields.amount'))
|
||||
->money('TMT')
|
||||
->sortable(),
|
||||
TextColumn::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->limit(40)
|
||||
->toggleable(),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -14,11 +14,15 @@ class DepartmentForm
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('name')
|
||||
->label(__('hr.fields.name'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
|
||||
Textarea::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
|
||||
Toggle::make('is_active')
|
||||
->label(__('hr.fields.active'))
|
||||
->default(true)
|
||||
|
||||
@@ -13,20 +13,27 @@ class DepartmentInfolist
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('name'),
|
||||
TextEntry::make('code'),
|
||||
TextEntry::make('name')
|
||||
->label(__('hr.fields.name')),
|
||||
TextEntry::make('code')
|
||||
->label(__('hr.fields.code')),
|
||||
TextEntry::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
IconEntry::make('is_active')
|
||||
->label(__('hr.fields.status'))
|
||||
->boolean(),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (Department $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -20,12 +20,15 @@ class DepartmentsTable
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('name')
|
||||
->label(__('hr.fields.name'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('code')
|
||||
->label(__('hr.fields.code'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->limit(50)
|
||||
->toggleable(),
|
||||
TextColumn::make('is_active')
|
||||
@@ -35,14 +38,17 @@ class DepartmentsTable
|
||||
->color(fn (bool $state): string => $state ? 'success' : 'danger')
|
||||
->sortable(),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -18,16 +18,20 @@ class DisciplinaryReportForm
|
||||
->components([
|
||||
HrForm::employeeSelect(),
|
||||
DatePicker::make('report_date')
|
||||
->label(__('hr.fields.report_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
TextInput::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->required()
|
||||
->rows(4)
|
||||
->columnSpanFull(),
|
||||
Select::make('severity')
|
||||
->label(__('hr.fields.severity'))
|
||||
->options(DisciplinarySeverity::class)
|
||||
->required()
|
||||
->native(false),
|
||||
|
||||
@@ -15,24 +15,33 @@ class DisciplinaryReportInfolist
|
||||
TextEntry::make('employee.id')
|
||||
->label(__('hr.fields.employee')),
|
||||
TextEntry::make('report_date')
|
||||
->label(__('hr.fields.report_date'))
|
||||
->date(),
|
||||
TextEntry::make('title'),
|
||||
TextEntry::make('title')
|
||||
->label(__('hr.fields.title')),
|
||||
TextEntry::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('severity')
|
||||
->label(__('hr.fields.severity'))
|
||||
->badge(),
|
||||
TextEntry::make('attachment_path')
|
||||
->label(__('hr.fields.attachment'))
|
||||
->placeholder('-'),
|
||||
TextEntry::make('created_by')
|
||||
->label(__('hr.fields.created_by'))
|
||||
->numeric()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (DisciplinaryReport $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -27,12 +27,15 @@ class DisciplinaryReportsTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('report_date')
|
||||
->label(__('hr.fields.report_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('severity')
|
||||
->label(__('hr.fields.severity'))
|
||||
->badge()
|
||||
->color(fn (DisciplinarySeverity $state): string => $state->color())
|
||||
->formatStateUsing(fn (DisciplinarySeverity $state): string => $state->label())
|
||||
@@ -48,20 +51,24 @@ class DisciplinaryReportsTable
|
||||
->sortable()
|
||||
->toggleable(),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('severity')
|
||||
->label(__('hr.fields.severity'))
|
||||
->options(DisciplinarySeverity::class),
|
||||
TrashedFilter::make(),
|
||||
])
|
||||
|
||||
@@ -16,10 +16,12 @@ class EmployeeDocumentForm
|
||||
->components([
|
||||
HrForm::employeeSelect(),
|
||||
Select::make('document_type')
|
||||
->label(__('hr.fields.document_type'))
|
||||
->options(DocumentType::class)
|
||||
->required()
|
||||
->native(false),
|
||||
TextInput::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
HrForm::fileUpload('file_path')
|
||||
|
||||
@@ -15,18 +15,25 @@ class EmployeeDocumentInfolist
|
||||
TextEntry::make('employee.id')
|
||||
->label(__('hr.fields.employee')),
|
||||
TextEntry::make('document_type')
|
||||
->label(__('hr.fields.document_type'))
|
||||
->badge(),
|
||||
TextEntry::make('title'),
|
||||
TextEntry::make('file_path'),
|
||||
TextEntry::make('title')
|
||||
->label(__('hr.fields.title')),
|
||||
TextEntry::make('file_path')
|
||||
->label(__('hr.fields.file_path')),
|
||||
TextEntry::make('uploaded_at')
|
||||
->label(__('hr.fields.uploaded_at'))
|
||||
->dateTime(),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (EmployeeDocument $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -35,21 +35,26 @@ class EmployeeDocumentsTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('uploaded_at')
|
||||
->label(__('hr.fields.uploaded_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -37,19 +37,23 @@ class BonusesRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
DatePicker::make('bonus_date')
|
||||
->label(__('hr.fields.bonus_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
Select::make('bonus_type')
|
||||
->label(__('hr.fields.bonus_type'))
|
||||
->options(BonusType::class)
|
||||
->required()
|
||||
->native(false),
|
||||
TextInput::make('amount')
|
||||
->label(__('hr.fields.amount'))
|
||||
->required()
|
||||
->numeric()
|
||||
->prefix('TMT')
|
||||
->minValue(0)
|
||||
->step(0.01),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
@@ -61,6 +65,7 @@ class BonusesRelationManager extends RelationManager
|
||||
->recordTitleAttribute('bonus_date')
|
||||
->columns([
|
||||
TextColumn::make('bonus_date')
|
||||
->label(__('hr.fields.bonus_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('bonus_type')
|
||||
@@ -70,9 +75,11 @@ class BonusesRelationManager extends RelationManager
|
||||
->formatStateUsing(fn (BonusType $state): string => $state->label())
|
||||
->sortable(),
|
||||
TextColumn::make('amount')
|
||||
->label(__('hr.fields.amount'))
|
||||
->money('TMT')
|
||||
->sortable(),
|
||||
TextColumn::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->limit(40)
|
||||
->toggleable(),
|
||||
])
|
||||
|
||||
@@ -39,16 +39,20 @@ class DisciplinaryReportsRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
DatePicker::make('report_date')
|
||||
->label(__('hr.fields.report_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
TextInput::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->required()
|
||||
->rows(4)
|
||||
->columnSpanFull(),
|
||||
Select::make('severity')
|
||||
->label(__('hr.fields.severity'))
|
||||
->options(DisciplinarySeverity::class)
|
||||
->required()
|
||||
->native(false),
|
||||
@@ -65,12 +69,15 @@ class DisciplinaryReportsRelationManager extends RelationManager
|
||||
->recordTitleAttribute('title')
|
||||
->columns([
|
||||
TextColumn::make('report_date')
|
||||
->label(__('hr.fields.report_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('severity')
|
||||
->label(__('hr.fields.severity'))
|
||||
->badge()
|
||||
->color(fn (DisciplinarySeverity $state): string => $state->color())
|
||||
->formatStateUsing(fn (DisciplinarySeverity $state): string => $state->label())
|
||||
@@ -86,6 +93,7 @@ class DisciplinaryReportsRelationManager extends RelationManager
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('severity')
|
||||
->label(__('hr.fields.severity'))
|
||||
->options(DisciplinarySeverity::class),
|
||||
TrashedFilter::make(),
|
||||
])
|
||||
|
||||
@@ -39,10 +39,12 @@ class DocumentsRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
Select::make('document_type')
|
||||
->label(__('hr.fields.document_type'))
|
||||
->options(DocumentType::class)
|
||||
->required()
|
||||
->native(false),
|
||||
TextInput::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
HrForm::fileUpload('file_path')
|
||||
@@ -65,9 +67,11 @@ class DocumentsRelationManager extends RelationManager
|
||||
->formatStateUsing(fn (DocumentType $state): string => $state->label())
|
||||
->sortable(),
|
||||
TextColumn::make('title')
|
||||
->label(__('hr.fields.title'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('uploaded_at')
|
||||
->label(__('hr.fields.uploaded_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -36,12 +36,15 @@ class ExplanationsRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
DatePicker::make('explanation_date')
|
||||
->label(__('hr.fields.explanation_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
TextInput::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->required()
|
||||
->rows(4)
|
||||
->columnSpanFull(),
|
||||
@@ -58,12 +61,15 @@ class ExplanationsRelationManager extends RelationManager
|
||||
->recordTitleAttribute('reason')
|
||||
->columns([
|
||||
TextColumn::make('explanation_date')
|
||||
->label(__('hr.fields.explanation_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->searchable()
|
||||
->limit(40),
|
||||
TextColumn::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->limit(50)
|
||||
->toggleable(),
|
||||
IconColumn::make('attachment_path')
|
||||
|
||||
@@ -34,6 +34,7 @@ class GiftsRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
DatePicker::make('gift_date')
|
||||
->label(__('hr.fields.gift_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
TextInput::make('gift_name')
|
||||
@@ -41,6 +42,7 @@ class GiftsRelationManager extends RelationManager
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('value')
|
||||
->label(__('hr.fields.value'))
|
||||
->required()
|
||||
->numeric()
|
||||
->prefix('TMT')
|
||||
@@ -48,6 +50,7 @@ class GiftsRelationManager extends RelationManager
|
||||
->step(0.01)
|
||||
->default(0),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
@@ -59,6 +62,7 @@ class GiftsRelationManager extends RelationManager
|
||||
->recordTitleAttribute('gift_name')
|
||||
->columns([
|
||||
TextColumn::make('gift_date')
|
||||
->label(__('hr.fields.gift_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('gift_name')
|
||||
@@ -66,9 +70,11 @@ class GiftsRelationManager extends RelationManager
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('value')
|
||||
->label(__('hr.fields.value'))
|
||||
->money('TMT')
|
||||
->sortable(),
|
||||
TextColumn::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->limit(40)
|
||||
->toggleable(),
|
||||
])
|
||||
|
||||
@@ -34,12 +34,14 @@ class SickLeavesRelationManager extends RelationManager
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
|
||||
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
|
||||
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')),
|
||||
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')),
|
||||
HrForm::leaveDaysDisplay(),
|
||||
TextInput::make('medical_institution')
|
||||
->label(__('hr.fields.institution'))
|
||||
->maxLength(255),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
HrForm::fileUpload('document_path')
|
||||
@@ -55,15 +57,19 @@ class SickLeavesRelationManager extends RelationManager
|
||||
->recordTitleAttribute('start_date')
|
||||
->columns([
|
||||
TextColumn::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('medical_institution')
|
||||
->label(__('hr.fields.institution'))
|
||||
->searchable()
|
||||
->toggleable(),
|
||||
IconColumn::make('document_path')
|
||||
|
||||
@@ -38,10 +38,11 @@ class UnpaidLeavesRelationManager extends RelationManager
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
|
||||
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
|
||||
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')),
|
||||
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')),
|
||||
HrForm::leaveDaysDisplay(),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
@@ -53,15 +54,19 @@ class UnpaidLeavesRelationManager extends RelationManager
|
||||
->recordTitleAttribute('start_date')
|
||||
->columns([
|
||||
TextColumn::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->badge()
|
||||
->color(fn (ApprovalStatus $state): string => $state->color())
|
||||
->formatStateUsing(fn (ApprovalStatus $state): string => $state->label())
|
||||
@@ -72,6 +77,7 @@ class UnpaidLeavesRelationManager extends RelationManager
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->options(ApprovalStatus::class),
|
||||
TrashedFilter::make(),
|
||||
])
|
||||
|
||||
@@ -42,15 +42,17 @@ class VacationsRelationManager extends RelationManager
|
||||
return $schema
|
||||
->components([
|
||||
Select::make('type')
|
||||
->label(__('hr.fields.type'))
|
||||
->options(VacationType::class)
|
||||
->required()
|
||||
->native(false),
|
||||
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
|
||||
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
|
||||
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')),
|
||||
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')),
|
||||
DatePicker::make('return_date')
|
||||
->label(__('hr.fields.return_date')),
|
||||
HrForm::leaveDaysDisplay(),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
HrForm::fileUpload('attachment_path')
|
||||
@@ -66,20 +68,25 @@ class VacationsRelationManager extends RelationManager
|
||||
->recordTitleAttribute('start_date')
|
||||
->columns([
|
||||
TextColumn::make('type')
|
||||
->label(__('hr.fields.type'))
|
||||
->badge()
|
||||
->color(fn (VacationType $state): string => $state->color())
|
||||
->formatStateUsing(fn (VacationType $state): string => $state->label())
|
||||
->sortable(),
|
||||
TextColumn::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->badge()
|
||||
->color(fn (ApprovalStatus $state): string => $state->color())
|
||||
->formatStateUsing(fn (ApprovalStatus $state): string => $state->label())
|
||||
@@ -90,8 +97,10 @@ class VacationsRelationManager extends RelationManager
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->options(ApprovalStatus::class),
|
||||
SelectFilter::make('type')
|
||||
->label(__('hr.fields.type'))
|
||||
->options(VacationType::class),
|
||||
TrashedFilter::make(),
|
||||
])
|
||||
|
||||
@@ -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(),
|
||||
])
|
||||
|
||||
@@ -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(),
|
||||
])
|
||||
|
||||
@@ -32,6 +32,7 @@ class EmployeesTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('full_name')
|
||||
->label(__('hr.fields.full_name'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('national_id')
|
||||
@@ -39,11 +40,13 @@ class EmployeesTable
|
||||
->searchable()
|
||||
->toggleable(),
|
||||
TextColumn::make('gender')
|
||||
->label(__('hr.fields.gender'))
|
||||
->badge()
|
||||
->color(fn (Gender $state): string => $state->color())
|
||||
->formatStateUsing(fn (Gender $state): string => $state->label())
|
||||
->searchable(),
|
||||
TextColumn::make('phone')
|
||||
->label(__('hr.fields.phone'))
|
||||
->searchable()
|
||||
->toggleable(),
|
||||
TextColumn::make('department.name')
|
||||
@@ -72,21 +75,26 @@ class EmployeesTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('hire_date')
|
||||
->label(__('hr.fields.hire_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('termination_date')
|
||||
->label(__('hr.fields.termination_date'))
|
||||
->date()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -16,12 +16,15 @@ class ExplanationForm
|
||||
->components([
|
||||
HrForm::employeeSelect(),
|
||||
DatePicker::make('explanation_date')
|
||||
->label(__('hr.fields.explanation_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
TextInput::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->required()
|
||||
->rows(4)
|
||||
->columnSpanFull(),
|
||||
|
||||
@@ -15,19 +15,26 @@ class ExplanationInfolist
|
||||
TextEntry::make('employee.id')
|
||||
->label(__('hr.fields.employee')),
|
||||
TextEntry::make('explanation_date')
|
||||
->label(__('hr.fields.explanation_date'))
|
||||
->date(),
|
||||
TextEntry::make('reason'),
|
||||
TextEntry::make('reason')
|
||||
->label(__('hr.fields.reason')),
|
||||
TextEntry::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('attachment_path')
|
||||
->label(__('hr.fields.attachment'))
|
||||
->placeholder('-'),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (Explanation $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -24,12 +24,15 @@ class ExplanationsTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('explanation_date')
|
||||
->label(__('hr.fields.explanation_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->searchable()
|
||||
->limit(40),
|
||||
TextColumn::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->limit(50)
|
||||
->toggleable(),
|
||||
IconColumn::make('attachment_path')
|
||||
@@ -38,14 +41,17 @@ class ExplanationsTable
|
||||
->trueIcon('heroicon-o-paper-clip')
|
||||
->falseIcon('heroicon-o-minus'),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -16,6 +16,7 @@ class GiftForm
|
||||
->components([
|
||||
HrForm::employeeSelect(),
|
||||
DatePicker::make('gift_date')
|
||||
->label(__('hr.fields.gift_date'))
|
||||
->required()
|
||||
->default(now()),
|
||||
TextInput::make('gift_name')
|
||||
@@ -23,6 +24,7 @@ class GiftForm
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('value')
|
||||
->label(__('hr.fields.value'))
|
||||
->required()
|
||||
->numeric()
|
||||
->prefix('TMT')
|
||||
@@ -30,6 +32,7 @@ class GiftForm
|
||||
->step(0.01)
|
||||
->default(0),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
|
||||
@@ -15,20 +15,27 @@ class GiftInfolist
|
||||
TextEntry::make('employee.id')
|
||||
->label(__('hr.fields.employee')),
|
||||
TextEntry::make('gift_date')
|
||||
->label(__('hr.fields.gift_date'))
|
||||
->date(),
|
||||
TextEntry::make('gift_name'),
|
||||
TextEntry::make('gift_name')
|
||||
->label(__('hr.fields.gift_name')),
|
||||
TextEntry::make('value')
|
||||
->label(__('hr.fields.value'))
|
||||
->numeric(),
|
||||
TextEntry::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (Gift $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -23,6 +23,7 @@ class GiftsTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('gift_date')
|
||||
->label(__('hr.fields.gift_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('gift_name')
|
||||
@@ -30,20 +31,25 @@ class GiftsTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('value')
|
||||
->label(__('hr.fields.value'))
|
||||
->money('TMT')
|
||||
->sortable(),
|
||||
TextColumn::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->limit(40)
|
||||
->toggleable(),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -13,9 +13,11 @@ class PositionForm
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('name')
|
||||
->label(__('hr.fields.name'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
|
||||
@@ -12,17 +12,22 @@ class PositionInfolist
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('name'),
|
||||
TextEntry::make('name')
|
||||
->label(__('hr.fields.name')),
|
||||
TextEntry::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (Position $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -19,21 +19,26 @@ class PositionsTable
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('name')
|
||||
->label(__('hr.fields.name'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->searchable()
|
||||
->limit(50)
|
||||
->toggleable(),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -15,9 +15,11 @@ class ShiftForm
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('name')
|
||||
->label(__('hr.fields.name'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('code')
|
||||
->label(__('hr.fields.code'))
|
||||
->required()
|
||||
->maxLength(50)
|
||||
->unique(ignoreRecord: true),
|
||||
@@ -30,6 +32,7 @@ class ShiftForm
|
||||
->required()
|
||||
->seconds(false),
|
||||
Textarea::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
Toggle::make('is_active')
|
||||
|
||||
@@ -13,26 +13,35 @@ class ShiftInfolist
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('name'),
|
||||
TextEntry::make('code'),
|
||||
TextEntry::make('name')
|
||||
->label(__('hr.fields.name')),
|
||||
TextEntry::make('code')
|
||||
->label(__('hr.fields.code')),
|
||||
TextEntry::make('starts_at')
|
||||
->label(__('hr.fields.starts_at'))
|
||||
->time()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('ends_at')
|
||||
->label(__('hr.fields.ends_at'))
|
||||
->time()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
IconEntry::make('is_active')
|
||||
->label(__('hr.fields.status'))
|
||||
->boolean(),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (Shift $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -20,9 +20,11 @@ class ShiftsTable
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('name')
|
||||
->label(__('hr.fields.name'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('code')
|
||||
->label(__('hr.fields.code'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('starts_at')
|
||||
@@ -34,6 +36,7 @@ class ShiftsTable
|
||||
->time()
|
||||
->sortable(),
|
||||
TextColumn::make('description')
|
||||
->label(__('hr.fields.description'))
|
||||
->limit(50)
|
||||
->toggleable(),
|
||||
TextColumn::make('is_active')
|
||||
@@ -43,14 +46,17 @@ class ShiftsTable
|
||||
->color(fn (bool $state): string => $state ? 'success' : 'danger')
|
||||
->sortable(),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -14,12 +14,14 @@ class SickLeaveForm
|
||||
return $schema
|
||||
->components([
|
||||
HrForm::employeeSelect(),
|
||||
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
|
||||
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
|
||||
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')),
|
||||
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')),
|
||||
HrForm::leaveDaysDisplay(),
|
||||
TextInput::make('medical_institution')
|
||||
->label(__('hr.fields.institution'))
|
||||
->maxLength(255),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
HrForm::fileUpload('document_path')
|
||||
|
||||
@@ -15,25 +15,34 @@ class SickLeaveInfolist
|
||||
TextEntry::make('employee.id')
|
||||
->label(__('hr.fields.employee')),
|
||||
TextEntry::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date(),
|
||||
TextEntry::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date(),
|
||||
TextEntry::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric(),
|
||||
TextEntry::make('medical_institution')
|
||||
->label(__('hr.fields.institution'))
|
||||
->placeholder('-'),
|
||||
TextEntry::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('document_path')
|
||||
->label(__('hr.fields.medical_document'))
|
||||
->placeholder('-'),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (SickLeave $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -24,15 +24,19 @@ class SickLeavesTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('medical_institution')
|
||||
->label(__('hr.fields.institution'))
|
||||
->searchable()
|
||||
->toggleable(),
|
||||
IconColumn::make('document_path')
|
||||
@@ -42,14 +46,17 @@ class SickLeavesTable
|
||||
->falseIcon('heroicon-o-document')
|
||||
->sortable(),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
|
||||
@@ -13,10 +13,11 @@ class UnpaidLeaveForm
|
||||
return $schema
|
||||
->components([
|
||||
HrForm::employeeSelect(),
|
||||
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
|
||||
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
|
||||
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')),
|
||||
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')),
|
||||
HrForm::leaveDaysDisplay(),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
|
||||
@@ -15,29 +15,39 @@ class UnpaidLeaveInfolist
|
||||
TextEntry::make('employee.id')
|
||||
->label(__('hr.fields.employee')),
|
||||
TextEntry::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date(),
|
||||
TextEntry::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date(),
|
||||
TextEntry::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric(),
|
||||
TextEntry::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->badge(),
|
||||
TextEntry::make('approved_by')
|
||||
->label(__('hr.fields.approved_by'))
|
||||
->numeric()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('approved_at')
|
||||
->label(__('hr.fields.approved_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (UnpaidLeave $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -32,15 +32,19 @@ class UnpaidLeavesTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->badge()
|
||||
->color(fn (ApprovalStatus $state): string => $state->color())
|
||||
->formatStateUsing(fn (ApprovalStatus $state): string => $state->label())
|
||||
@@ -50,24 +54,29 @@ class UnpaidLeavesTable
|
||||
->label(__('hr.fields.approved_by'))
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('approved_at')
|
||||
->label(__('hr.fields.approved_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->options(ApprovalStatus::class),
|
||||
Filter::make('date_range')
|
||||
->label(__('hr.fields.date_range'))
|
||||
|
||||
@@ -16,6 +16,7 @@ class UserForm
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('name')
|
||||
->label(__('hr.fields.name'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('email')
|
||||
@@ -25,6 +26,7 @@ class UserForm
|
||||
->maxLength(255)
|
||||
->unique(ignoreRecord: true),
|
||||
TextInput::make('password')
|
||||
->label(__('hr.fields.password'))
|
||||
->password()
|
||||
->dehydrateStateUsing(fn (?string $state): ?string => filled($state) ? Hash::make($state) : null)
|
||||
->dehydrated(fn (?string $state): bool => filled($state))
|
||||
@@ -43,6 +45,7 @@ class UserForm
|
||||
->required()
|
||||
->default(config('hr.default_locale')),
|
||||
Select::make('roles')
|
||||
->label(__('hr.fields.roles'))
|
||||
->relationship('roles', 'name')
|
||||
->multiple()
|
||||
->preload()
|
||||
|
||||
@@ -11,16 +11,20 @@ class UserInfolist
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('name'),
|
||||
TextEntry::make('name')
|
||||
->label(__('hr.fields.name')),
|
||||
TextEntry::make('email')
|
||||
->label(__('hr.fields.email_address')),
|
||||
TextEntry::make('email_verified_at')
|
||||
->label(__('hr.fields.email_verified_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('department.name')
|
||||
|
||||
@@ -16,22 +16,27 @@ class UsersTable
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('name')
|
||||
->label(__('hr.fields.name'))
|
||||
->searchable(),
|
||||
TextColumn::make('email')
|
||||
->label(__('hr.fields.email_address'))
|
||||
->searchable(),
|
||||
TextColumn::make('email_verified_at')
|
||||
->label(__('hr.fields.email_verified_at'))
|
||||
->dateTime()
|
||||
->sortable(),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('department.name')
|
||||
->label(__('hr.fields.department'))
|
||||
->searchable(),
|
||||
])
|
||||
->filters([
|
||||
|
||||
@@ -17,15 +17,17 @@ class VacationForm
|
||||
->components([
|
||||
HrForm::employeeSelect(),
|
||||
Select::make('type')
|
||||
->label(__('hr.fields.type'))
|
||||
->options(VacationType::class)
|
||||
->required()
|
||||
->native(false),
|
||||
HrForm::leaveDatePicker('start_date', __(hr.fields.start_date)),
|
||||
HrForm::leaveDatePicker('end_date', __(hr.fields.end_date)),
|
||||
HrForm::leaveDatePicker('start_date', __('hr.fields.start_date')),
|
||||
HrForm::leaveDatePicker('end_date', __('hr.fields.end_date')),
|
||||
DatePicker::make('return_date')
|
||||
->label(__('hr.fields.return_date')),
|
||||
HrForm::leaveDaysDisplay(),
|
||||
Textarea::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
HrForm::fileUpload('attachment_path')
|
||||
|
||||
@@ -15,36 +15,49 @@ class VacationInfolist
|
||||
TextEntry::make('employee.id')
|
||||
->label(__('hr.fields.employee')),
|
||||
TextEntry::make('type')
|
||||
->label(__('hr.fields.type'))
|
||||
->badge(),
|
||||
TextEntry::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date(),
|
||||
TextEntry::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date(),
|
||||
TextEntry::make('return_date')
|
||||
->label(__('hr.fields.return_date'))
|
||||
->date()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric(),
|
||||
TextEntry::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->badge(),
|
||||
TextEntry::make('reason')
|
||||
->label(__('hr.fields.reason'))
|
||||
->placeholder('-')
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('attachment_path')
|
||||
->label(__('hr.fields.attachment'))
|
||||
->placeholder('-'),
|
||||
TextEntry::make('approved_by')
|
||||
->label(__('hr.fields.approved_by'))
|
||||
->numeric()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('approved_at')
|
||||
->label(__('hr.fields.approved_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->placeholder('-'),
|
||||
TextEntry::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->visible(fn (Vacation $record): bool => $record->trashed()),
|
||||
]);
|
||||
|
||||
@@ -34,21 +34,26 @@ class VacationsTable
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('type')
|
||||
->label(__('hr.fields.type'))
|
||||
->badge()
|
||||
->color(fn (VacationType $state): string => $state->color())
|
||||
->formatStateUsing(fn (VacationType $state): string => $state->label())
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('start_date')
|
||||
->label(__('hr.fields.start_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('end_date')
|
||||
->label(__('hr.fields.end_date'))
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('days')
|
||||
->label(__('hr.fields.days'))
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->badge()
|
||||
->color(fn (ApprovalStatus $state): string => $state->color())
|
||||
->formatStateUsing(fn (ApprovalStatus $state): string => $state->label())
|
||||
@@ -58,26 +63,32 @@ class VacationsTable
|
||||
->label(__('hr.fields.approved_by'))
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('approved_at')
|
||||
->label(__('hr.fields.approved_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('created_at')
|
||||
->label(__('hr.fields.created_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->label(__('hr.fields.updated_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('deleted_at')
|
||||
->label(__('hr.fields.deleted_at'))
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')
|
||||
->label(__('hr.fields.status'))
|
||||
->options(ApprovalStatus::class),
|
||||
SelectFilter::make('type')
|
||||
->label(__('hr.fields.type'))
|
||||
->options(VacationType::class),
|
||||
Filter::make('date_range')
|
||||
->label(__('hr.fields.date_range'))
|
||||
|
||||
@@ -26,6 +26,7 @@ class HrForm
|
||||
public static function employeeSelect(): Select
|
||||
{
|
||||
return Select::make('employee_id')
|
||||
->label(__('hr.fields.employee'))
|
||||
->relationship('employee', 'full_name')
|
||||
->searchable()
|
||||
->preload()
|
||||
|
||||
@@ -120,6 +120,21 @@ return [
|
||||
'start_date' => 'Start Date',
|
||||
'end_date' => 'End Date',
|
||||
'institution' => 'Institution',
|
||||
'code' => 'Code',
|
||||
'password' => 'Password',
|
||||
'roles' => 'Roles',
|
||||
'value' => 'Value',
|
||||
'gift_date' => 'Gift Date',
|
||||
'explanation_date' => 'Explanation Date',
|
||||
'document_type' => 'Document Type',
|
||||
'approved_at' => 'Approved At',
|
||||
'uploaded_at' => 'Uploaded At',
|
||||
'created_at' => 'Created At',
|
||||
'updated_at' => 'Updated At',
|
||||
'deleted_at' => 'Deleted At',
|
||||
'email_verified_at' => 'Email Verified At',
|
||||
'event' => 'Event',
|
||||
'file_path' => 'File Path',
|
||||
],
|
||||
|
||||
'tabs' => [
|
||||
|
||||
@@ -120,6 +120,21 @@ return [
|
||||
'start_date' => 'Дата начала',
|
||||
'end_date' => 'Дата окончания',
|
||||
'institution' => 'Учреждение',
|
||||
'code' => 'Код',
|
||||
'password' => 'Пароль',
|
||||
'roles' => 'Роли',
|
||||
'value' => 'Значение',
|
||||
'gift_date' => 'Дата подарка',
|
||||
'explanation_date' => 'Дата объяснительной',
|
||||
'document_type' => 'Тип документа',
|
||||
'approved_at' => 'Дата утверждения',
|
||||
'uploaded_at' => 'Дата загрузки',
|
||||
'created_at' => 'Дата создания',
|
||||
'updated_at' => 'Дата обновления',
|
||||
'deleted_at' => 'Дата удаления',
|
||||
'email_verified_at' => 'Дата подтверждения email',
|
||||
'event' => 'Событие',
|
||||
'file_path' => 'Путь к файлу',
|
||||
],
|
||||
|
||||
'tabs' => [
|
||||
|
||||
@@ -120,6 +120,21 @@ return [
|
||||
'start_date' => 'Başlanan senesi',
|
||||
'end_date' => 'Tamamlanan senesi',
|
||||
'institution' => 'Gurama',
|
||||
'code' => 'Kod',
|
||||
'password' => 'Parol',
|
||||
'roles' => 'Rollar',
|
||||
'value' => 'Bahasy',
|
||||
'gift_date' => 'Sowgat senesi',
|
||||
'explanation_date' => 'Düşündiriş senesi',
|
||||
'document_type' => 'Resminama görnüşi',
|
||||
'approved_at' => 'Tassyklanan wagty',
|
||||
'uploaded_at' => 'Ýüklenen wagty',
|
||||
'created_at' => 'Döredilen wagty',
|
||||
'updated_at' => 'Täzelenen wagty',
|
||||
'deleted_at' => 'Pozulan wagty',
|
||||
'email_verified_at' => 'Email tassyklanan wagty',
|
||||
'event' => 'Waka',
|
||||
'file_path' => 'Faýl ýoly',
|
||||
],
|
||||
|
||||
'tabs' => [
|
||||
|
||||
Reference in New Issue
Block a user