Öncelikle config/database.php içerisindeki mysql ayarlarının bir kopyasını oluşturun, adı
remote olsun ya da ne verirseniz. Ben
remote olarak örnek vereceğim
'remote' => [
'driver' => 'mysql',
'host' => 'uzak-veritabani-ip-adresi',
'port' => 'uzak-veritabani-port',
'database' => 'uzak-veritabani-adi',
'username' => 'root',
'password' => '12345678',
'unix_socket' => null,
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
],
gibi.
Sonra User modeline protected $connection sınıf değişkenini yeni bağlantı adı ile, yani
remote, ekleyin:
protected $connection = 'remote';