$teams = DB::table('teams')
->select("teams.*","matches.result"
,DB::raw('matches.result, COALESCE(count(matches.result),0) as point'))
->leftjoin("matches","matches.result","=","teams.teamName")
->groupBy('matches.result')
->get();
Laravel