Calling the undefined method Illuminate Database Eloquent Relationships BelongsToMany :: whithPivot () laravel 5.8

My problem is like that, I have a table topics who has a many-to-many relationship with a table of teachers using an intermediate table subject professorbut when I want to use this relationship, I get the error that the function avecPivot It's not defined, but I have a one-to-many relationship that works well, so I do not know where the problem may be.

The model of Topic:

/ **
* Teachers who belong to the subject.
* /
public service teachers ()
{
returns $ this-> belongsToMany (& # 39;  App  Teacher & # 39 ;, & # 39; subject_teachers & # 39;)
-> whithPivot (& # 39; professor_id & # 39;);
}

The model of Professor:

/ **
* The subjects that belong to the teacher.
* /
public service topics ()
{
returns $ this-> belongsToMany (& # 39;  App  Subject & # 39 ;, & # 39; subject_teachers & # 39;)
-> withPivot (& # 39; topics_id & # 39;);
}

and the model that has both id:

SubjectTeacher class extends the model
{
public $ timestamps = false;

protected $ table = & # 39; topics_teachers & # 39 ;;
protected $ primaryKey = idSubjectsTeachers & # 39 ;;
protected $ fillable = ['subjects_id','teachers_id'];
}

To do the test and see if the data is obtained, I do it as follows:

$ teachers = Teacher :: find (1);
$ topics = $ teachers-> topics () -> get ();
dd ($ subjects);

If you could help me, I would appreciate it a lot.