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:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
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 @@ class EmployeesExport implements FromQuery, WithHeadings, WithMapping
|
||||
return [
|
||||
'Employee Number',
|
||||
'Full Name',
|
||||
'National ID',
|
||||
'Nationality',
|
||||
'Gender',
|
||||
'Birth Date',
|
||||
'Phone',
|
||||
@@ -63,7 +64,7 @@ class EmployeesExport implements FromQuery, WithHeadings, WithMapping
|
||||
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