How to get pivot data from hooks

Hi everyone
I wonder if there are any nicer way to get pivot data from hook file

Here is one of my hook functions

ChatroomHook.checkChatroomUser = async (chatroom) => {
  let users = (await chatroom.users().fetch()).toJSON()
  users = users.filter(user => !== chatroom.$sideLoaded.pivot_user_id)
  chatroom.profiles = => user.profile_picture)
  chatroom.type = users.length > 2 ? 'group' : 'personal'

There I used $sideLoaded.pivot_user_id
I saw it after I logged this in my terminal console.log(chatroom)
Is it normal?
Or is there any nicer way?

That’s normal

Ok, thanks

I use so: item.toJSON().__meta__