ДК
$query = TABLE1::where('zid', 1)
->where('zsize', '40')
->with(['TABLE1_TABLE2' => function ($join) use ($base_date_start, $base_date_end) {
$join->whereDate('parsed_at', '>=', $base_date_start);
$join->whereDate('parsed_at', '<=', $base_date_end);
}]);
\DB::table('TABLE1 as t1')
->select(\DB::raw('COUNT( DISTINCT t2.parsed_at )'))
->leftJoin('TABLE2 as t2', static function(JoinClause $join) {
$join->on('t2.id', 't1.id');
$join->where('t2.parsed_at', '>=', '2020-05-01');
$join->where('t2.parsed_at', '<=', '2020-05-25');
})
->where('t1.zid', 1)
->where('t1.size', '40')
->where('t2.q', '>', 0)
;