How to hide pivot key when using belongsToMany


#1

I don’t want to get pivot value from the pivot model and I tried.

 static get hidden() {
    return ["pivot"]
  }

It’s still.


#2

Hi,

Have you try to use hidde() method? to indicate which columns must to be invisible?

Here more info about it (hide columns)[https://adonisjs.com/docs/4.0/lucid#_hiding_fields]

Here an example


class User extends Model {
  static get hidden () {
    return ['password']
  }
}


#3

Here is what I have done so far. I think what you are talking about I already tried