@extends('layouts.master') @section('css') @endsection @section('title') FOC Details @endsection @section('content') FOC Free Qty @csrf @isset($stockItem) @if ($stockItem->stockItemFocs->where('type', 0)->count() > 0) @foreach ($stockItem->stockItemFocs->where('type', 0) as $key => $stockItemFoc) Unit @foreach ($units as $unit) unit_id == $unit->id ? 'selected' : '') : '' }}> {{ $unit->symbol }} @endforeach Quantity quantity }}> Free Quantity free_qty }}> @endforeach @else Unit @foreach ($units as $unit) {{ $unit->symbol }} @endforeach Quantity Free Quantity @endif @endisset Add Submit FOC Other Item @csrf @isset($stockItem) @if ($stockItem->stockItemFocs->where('type', 1)->count() > 0) @foreach ($stockItem->stockItemFocs->where('type', 1) as $key => $stockItemFoc) Unit @foreach ($units as $unit) unit_id == $unit->id ? 'selected' : '') : '' }}> {{ $unit->symbol }} @endforeach Quantity quantity }}> Item Select item {{ $stockItemFoc->otherItem->name }} Unit @php $unitIds = $stockItemFoc->otherItem->itemUnits ->pluck('unit_id') ->toArray(); $otherUnits = \App\Models\Unit::where( 'business_key', Auth::user()->business_key, ) ->whereIn('id', $unitIds) ->get(); @endphp @foreach ($otherUnits as $unit) other_unit_id == $unit->id ? 'selected' : '' }}> {{ $unit->symbol }} @endforeach Free Quantity free_qty }}> @endforeach {{-- @else Unit @foreach ($units as $unit) {{ $unit->symbol }} @endforeach Quantity Free Quantity --}} @endif @endisset Add Submit @endsection @section('script') @endsection