How to hide pivot key when using belongsToMany


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

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

It’s still.



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

Here more info about it (hide columns)[]

Here an example

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


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