Well $student here seems to be a collection of students. Because $stu = $parent->students; indicates that this returns multiple students. When you call toArray on a collection you get an array with arrays in there. In general, this shouldn't give the current error, but it also won't wind the result because that array with students doesn't have an id key.
Anyway, since you have collection methods you can do this way easier ;)
// Controller
if($auth->user()->getRoleNames() == '["Parent"]') {
$id = $auth->user()->Parents_id;
$parent = ParentName::find($id);
$students = $parent->students;
$announce = AnnounceMent::get();
$roletype='parent';
return view('announcement.index', compact('students','roletype','announce'));
}
// View
@foreach($announce as $ann)
@if ($students->contains('id', $ann->student_id))
// Your HTML here
@endif
@endforeach