Como remover valores repetitivos do loop foreach no php laravel
@foreach($sections as $section)
<div class="form-group">
<h2>{{ $section['section_name'] }}</h2>
<p>{{ $section['section_description'] }}</p>
<p>{{ $section['section_intro'] }}</p>
</div>
<div class="form-group ms-5">
@php
$questions = [];
foreach($section['question'] as $question){
$questions[$question['question_name']][] = $question['question_description'];
}
@endphp
@foreach($questions as $question_name=>$question_descriptions)
<h5>{{ $question_name }}</h5>
@foreach($question_descriptions as $question_description)
<p class="ms-3">{{ $question_description }}</p>
@endforeach
@endforeach
</div>
@endforeach
SAMER SAEID