I'm moving with laravel and I'm learning object orientation and wanted to do a select without using the join but as object oriented and I know I'm not getting it.
As I'm accustomed to using:
$results = DB::select("SELECT u.foto, u.Ninck,o.Idsala,p.Aceitou, u.Id FROM Onsalas o , Usuarios u, Partidas p WHERE (o.Idusuario=u.Id) AND (u.Id != $Id) AND(o.Idsala = $sala) AND ((p.IdDesafiado = $Idop) OR (p.IdDesafiante = $Idop)) ");
I tried to make all sorts of shapes all but unsuccessfully
Some ways I've tried:
$results = DB::table(' \'Onsalas\' , \'Usuarios\' ')
->select('Onsala.Id')->get();
$results = DB::table('Onsalas' , 'Usuarios')
->select('Onsala.Id')->get();
$results = DB::table('Onsalas')->table( 'Usuarios')
->select('Onsala.Id')->get();