public function findEmployee($id) { return Employee::whereUserId($id)->first(); }
/** * @param $request * @return mixed */ public function updateEmployee($request) { $user = collect(new User($request->all()))->toArray(); $employee = Employee::whereUserId($request->user_id)->first(); $employee->update($request->all()); $employee->user()->update($user); return $employee->load('user'); }