sql >> Base de Datos >  >> RDS >> Mysql

Unirse a 3 tablas en Laravel

$data = DB::table('businesses')
            ->join('notes', 'notes.business_id', '=', 'businesses.id')
            ->join('businessimages', 'businessimages.business_id', '=', 'businesses.id')
            ->select('businesses.*', 'notes.note', 'businessimages.image')
            ->get();