$data */ public function create(array $data): Employee { return Employee::create($data); } /** * @param array $data */ public function update(Employee $employee, array $data): Employee { $employee->update($data); return $employee->refresh(); } public function terminate(Employee $employee, ?Carbon $date = null): Employee { $employee->update([ 'employment_status' => EmploymentStatus::Terminated, 'termination_date' => $date ?? now(), ]); Notification::send( User::role('hr_manager')->get(), new EmployeeTerminatedNotification($employee), ); return $employee->refresh(); } }