Refactor employee management by implementing automatic employee number generation, updating national ID handling, and enhancing localization for gender and nationality fields across various resources. Adjust form components and validation logic to improve user experience and data integrity.
This commit is contained in:
1 parent
28cbef8eb5
commit
eed46157cd
25 files changed
+1175
-51
No files matched your search
@@ -5,6 +5,7 @@
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\Employee;
|
||||
use App\Support\Countries;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
@@ -39,7 +40,7 @@ public function headings(): array
|
||||
return [
|
||||
'Employee Number',
|
||||
'Full Name',
|
||||
'National ID',
|
||||
'Nationality',
|
||||
'Gender',
|
||||
'Birth Date',
|
||||
'Phone',
|
||||
@@ -63,7 +64,7 @@ public function map($employee): array
|
||||
return [
|
||||
$employee->employee_number,
|
||||
$employee->full_name,
|
||||
$employee->national_id,
|
||||
Countries::name($employee->national_id) ?? $employee->national_id,
|
||||
$employee->gender?->value,
|
||||
$employee->birth_date?->toDateString(),
|
||||
$employee->phone,
|
||||
|
||||
Reference in new issue
Block a user