Hello I have tried to Join tables from multiple database, below is my code I was just wondering if there is another or shorter way and best & safer approach in constructing my code.
$variable = Mymodel::join('database1.table1 as t1','t1.id','=','database2.table2.t1_id')->get();
And is it possible in Laravel to have relationship(1to1,1tomany,manytomany) of two table with a different database? Or only join method is the only way to connect them? If possible can please give some example thanks.