Well as per the standard way your pivot table has only two columns i.e. both table id's, but if you want to do this, laravel provide you flexibility.
just provide the info in your methods in models which key you want to use when fetching the data i.e lets say you have three tables Users, Posts, Comments. and want to connect all of them in one pivot table then do as follows
class User extends Authenticatable{
//when matching user_id and post_id
public function posts(){
return $this->hasMany('App\Posts', 'post_id');
}
//when matching user_id and comment_id
public function comments(){
return $this->hasMany('App\Comments', 'comment_id');
}
}