Came to be studying with us with 〜ことになる
Grammar Explanation: To end up being with 〜ことになる

A new student joins Conan’s elementary school classroom. The teacher introduces her.
- 先生:
- 「今日
( からみんなと勉強( する事( になった、灰原( 哀( さんです!」- “This is Ai Haibara. It came to be that she'll be studying with us starting today.”
- 「みんな仲良
( くしてあげてね!」- “Everyone be friendly with her!”
- “This is Ai Haibara. It came to be that she'll be studying with us starting today.”
Key Points
〜ことになった = it was decided that
Here the teacher is announcing an arranged new situation.
Ai has not “accidentally ended up” here; the school has determined that she will join the class.
みんなと勉強
( する is the content of that decisionThe full chunk means “to study together with everyone”.
ことになった wraps that whole action and turns it into the new arrangement.
Starting today is part of the announcement
今日
( から sets the starting point for the new situation.The teacher is formally introducing Haibara as a classmate from now on.