1
0
Fork 0

fix create problem

main
A1Gard 1 year ago
parent a3a62cd259
commit 98bfd2ed5f

@ -29,9 +29,9 @@
</label>
<select name="customer_id" data-live-search="true" id="customer_id"
class="form-control searchable @error('customer_id') is-invalid @enderror">
@foreach(\App\models\Customer::all() as $customer )
@foreach(\App\Models\Customer::all() as $customer )
<option value="{{ $customer->id }}"
@if (old('customer_id',$invoice->customer_id??null) == $customer->id ) selected @endif > {{$customer->name}} </option>
@if (old('customer_id',$invoice?->customer_id??null) == $customer->id ) selected @endif > {{$customer->name}} </option>
@endforeach
</select>
</div>
@ -76,6 +76,7 @@
value="{{old('tracking_code',$invoice->tracking_code??null)}}"/>
</div>
</div>
@if(isset($invoice))
@foreach($invoice->products as $product )
<div class="col-md-6">
@ -86,7 +87,8 @@
<label for="products">
{{__('Product')}}
</label>
<select data-live-search="true" name="products.ids[]" data-live-search="true" id="products"
<select data-live-search="true" name="products.ids[]"
data-live-search="true" id="products"
class="form-control searchable">
@foreach(\App\models\Product::all() as $allProduct )
<option value="{{ $allProduct->id }}"
@ -100,10 +102,12 @@
<label for="count">
{{__('Count')}}
</label>
<input type="number" name="products.counts[]" value="{{$product->pivot->count}}"
<input type="number" name="products.counts[]"
value="{{$product->pivot->count}}"
id="" class="form-control">
<button class="btn btn-outline-danger "
onclick="document.getElementById('product_{{$product->id}}').remove()"> X
onclick="document.getElementById('product_{{$product->id}}').remove()">
X
</button>
</div>
</div>
@ -113,6 +117,8 @@
</div>
@endforeach
@endif
<div class="col-md-12">
<label> &nbsp;</label>
<input name="" type="submit" class="btn btn-primary mt-2" value="{{__('Save')}}"/>

Loading…
Cancel
Save