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

Cómo convertir consultas mySQL a Laravel 5.4 Query Builder

DB::table('feeds')
    ->selectRaw('*, count(comments.comment_id) as comment_count')
    ->join('users', 'users.id', '=', 'feeds.user_id')
    ->join('comments', 'feeds.id', '=', 'comments.comment_feed_id')
    ->groupBy('comments.comment_feed_id')
    ->get();