@php $selectedUnit = $selectedUnit ?? ''; $testUnits = $testUnits ?? []; $selectedInList = in_array($selectedUnit, $testUnits, true); @endphp Select unit @foreach ($testUnits as $unitName) {{ $unitName }} @endforeach @if ($selectedUnit !== '' && ! $selectedInList) {{ $selectedUnit }} @endif + Add new