@php $categories = $language->categories; @endphp
@php
if ($equipment->vendor_id == null) {
$vendor_id = null;
} else {
$vendor_id = $equipment->vendor_id;
}
$locations = App\Models\Instrument\Location::where([['vendor_id', $vendor_id], ['language_id', $language->id]])
->orderBy('id', 'desc')
->get();
$eq_location_ids = App\Models\Instrument\EquipmentLocation::where([['equipment_id', $equipment->id], ['language_id', $language->id]])
->orderBy('id', 'desc')
->get();
$location_ids = [];
foreach ($eq_location_ids as $value) {
if (!in_array($value->location_id, $location_ids)) {
array_push($location_ids, $value->location_id);
}
}
@endphp