{!! Form::open(['role' => 'form', 'class' => 'form-horizontal form-groups', 'id' => 'mfnMraProductMappingForm']) !!} @foreach ($loanProductCatagory as $catagory) @php $products = DB::table('mfn_loans_product') ->selectRaw('id, name, shortName, code') ->where('productCategoryId', $catagory->id) ->where('status', '1') ->where('softDel', '0') ->orderBy('code', 'asc') ->get(); if( $products->isEmpty() ) continue; @endphp

{{$catagory->name}}

@foreach ($products as $product)
@if(in_array($product->id, ($allSelectedProducts ?? []) ) ) @if(in_array($product->id, ($mfnMraProductMappingExist ?? []) ) ) {{ Form::checkbox('loanProductIds[]', $product->id, true, array('disabled'=>'disabled')) }} @else {{ Form::checkbox('loanProductIds[]', $product->id, true, array('disabled'=>'disabled')) }} @endif @else @if(in_array($product->id, ($mfnMraProductMappingExist ?? []) ) ) {{ Form::checkbox('loanProductIds[]', $product->id, true, array()) }} @else {{ Form::checkbox('loanProductIds[]', $product->id, null, array()) }} @endif @endif
@endforeach
@endforeach

{!! Form::label('submit', ' ', ['class' => 'col-sm-5 control-label']) !!}
{!! Form::submit('Save', ['id' => 'mfnMraProductMappingFormSubmit', 'class' => 'btn btn-success']) !!} Close
{!! Form::close() !!}