$data = TheParent::whereHas('child', fn($q) => $q->where('column', 1)) ->with(['child' => fn($q) => $q->where('column', 1)]) ->get();