*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'name' => $this->name, 'email' => $this->email, 'username' => $this->username, 'phone' => $this->phone, 'gender' => $this->gender, 'address' => $this->address, 'created_at' => (string)$this->created_at, 'created_by' => new UserProfileResource($this->createdBy), 'company' => new SimpleCompanyResource($this->company), 'department' =>new SimpleDepartmentResource($this->department), 'role' => new RoleResource($this->role), 'status' =>$this->status, 'menus' => $this->menus ?: [], 'super_admin'=>Auth::user()->super_admin, 'fs_password'=>$this->fs_password, 'leader_id' => $this->leader_id, ]; } }