Для подзапросов такого рода вы можете использовать whereIn()
.
Кроме того, для логики внутри подзапроса вместо order by c.days DESC LIMIT 1
вы можете просто использовать max(c.days)
в предложении select.
DB::table('schedule as c')
->join('matches as m', 'm.id_match', '=', 'c.match_id')
->join('teams as th', 'm.team_h', '=', 'th.id_team')
->join('teams as ta', 'm.team_a', '=', 'ta.id_team')
->where('c.serie_id', '=', $sid)
->whereIn('c.days', function($query) use($sid){
$query->select('max(c.days)')
->from('schedule as c2')
->join('matches as m2', 'm2.id_match', '=', 'c2.match_id')
->where('c2.serie_id', '=', $sid)
->where('m2.match_stato', '=', 2);
})
->select('c.*', 'm.*', 'th.team as team_home', 'ta.team as team_away')
->orderBy('c.days', 'asc')
->orderBy('th.team', 'asc')
->get();
######