You need to setup a custom model for the pivot relation and then you should be able to use it to store it on the right connection.
Look under "Defining Custom Intermediate Table Models" https://laravel.com/docs/5.8/eloquent-relationships
Example:
// Action class
class Action extends Model
{
public function repair()
{
// use ActiolnRepair model for the pivot table
return $this->belongsToMany('App\Repair')->using('App\ActionRepair');
}
}
// Repair class
class Repair extends Model
{
public function action()
{
// use ActiolnRepair model for the pivot table
return $this->belongsToMany('App\Action')->using('App\ActionRepair');
}
}
And then the ActionRepair model needs to extend Illuminate\Database\Eloquent\Relations\Pivot
<?php
namespace App;
use Illuminate\Database\Eloquent\Relations\Pivot;
class ActionRepair extends Pivot
{
// setup db connections on this model
}