Mysql
 sql >> Database >  >> RDS >> Mysql

Unisciti a 3 tavoli in 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();