'date', 'termination_date' => 'date', 'national_code' => 'encrypted', 'bank_account' => 'encrypted', 'base_salary' => 'decimal:0', // ✅ جایگزین ]; public function tenant() { return $this->belongsTo(Tenant::class); } public function project() { return $this->belongsTo(Project::class); } public function currency() { return $this->belongsTo(Currency::class); } public function workLogs() { return $this->hasMany(WorkLog::class); } public function financials() { return $this->hasMany(EmployeeFinancial::class); } public function expenses() { return $this->hasMany(Expense::class, 'employee_id'); } public function getFullNameAttribute() { return $this->first_name . ' ' . $this->last_name; } public function getContractTypeLabelAttribute() { return [ 'full_time' => __('employee.contract_full_time'), 'part_time' => __('employee.contract_part_time'), 'contractor' => __('employee.contract_contractor'), 'daily' => __('employee.contract_daily'), ][$this->contract_type] ?? $this->contract_type; } public function getStatusLabelAttribute() { return [ 'active' => __('employee.active'), 'inactive' => __('employee.inactive'), 'terminated' => __('employee.terminated'), ][$this->status] ?? $this->status; } }