It is not a question of performance, you should avoid to get into loop-switch antipattern, just using strategy pattern. For your example you could simply do:
@if($report_data)
@foreach ($report_data as $report)
<div class="alert alert-danger">User reported for being {{$report->reason}}</div>
@endforeach
@endif
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community