@extends('layouts.iconbar') @section('title') Update Item @endsection @section('breadcrumbs') {{ Breadcrumbs::render(\Request::route()->getName(), $item) }} @endsection @section('content')
{!! Form::model($item, ['method' => 'PUT', 'route' => ['admin.inventory.update', $item->id], 'files' => true,]) !!}
{!! Form::select('category', $categories, old('category'), ['class' => 'form-control select2','id' => 'category', 'v-model' => 'category']) !!} {!! Form::label('category', 'Category', ['class' => 'floating-label main-label']) !!}

@if($errors->has('category'))

{{ $errors->first('category') }}

@endif
{!! Form::select('supplier_id', $suppliers, old('supplier_id', $item->supplier_id), ['class' => 'form-control select2','id' => 'supplier']) !!} {!! Form::label('supplier_id', 'Supplier', ['class' => 'floating-label main-label']) !!}

@if($errors->has('supplier_id'))

{{ $errors->first('supplier_id') }}

@endif
{!! Form::text('sku', old('sku'), ['class' => 'form-control']) !!} {!! Form::label('sku', trans('global.inventory.fields.sku').'', ['class' => 'floating-label']) !!}

@if($errors->has('sku'))

{{ $errors->first('sku') }}

@endif
{!! Form::text('name', old('name'), ['class' => 'form-control']) !!} {!! Form::label('name', trans('global.inventory.fields.name').'', ['class' => 'floating-label']) !!}

@if($errors->has('name'))

{{ $errors->first('name') }}

@endif
{!! Form::text('qty', old('qty', $item->qty), ['class' => 'form-control']) !!} {!! Form::label('qty', trans('global.inventory.fields.qty').'', ['class' => 'floating-label']) !!}

@if($errors->has('qty'))

{{ $errors->first('qty') }}

@endif
{!! Form::text('size', old('size', $item->size), ['class' => 'form-control']) !!} {!! Form::label('size', trans('global.inventory.fields.size').'', ['class' => 'floating-label']) !!}

@if($errors->has('size'))

{{ $errors->first('size') }}

@endif
{!! Form::label('cut_supply', trans('global.inventory.fields.cut_supply').'', ['class' => 'col-md-12 floating-label']) !!}
{!! Form::radio('cut_supply', 'Yes', ['v-model' => 'cut_supply', 'id' => 'cut_supply_yes']) !!}
{!! Form::radio('cut_supply', 'No', ['v-model' => 'cut_supply', 'id' => 'cut_supply_no']) !!}
@if($errors->has('cut_supply'))

{{ $errors->first('cut_supply') }}

@endif
{!! Form::text('finish', old('finish'), ['class' => 'form-control']) !!} {!! Form::label('finish', trans('global.inventory.fields.finish').'', ['class' => 'floating-label']) !!}

@if($errors->has('finish'))

{{ $errors->first('finish') }}

@endif
{!! Form::text('thickness', old('thickness'), ['class' => 'form-control']) !!} {!! Form::label('thickness', trans('global.inventory.fields.thickness').'', ['class' => 'floating-label']) !!}

@if($errors->has('thickness'))

{{ $errors->first('thickness') }}

@endif
{!! Form::text('colour_range', old('colour_range'), ['class' => 'form-control']) !!} {!! Form::label('colour_range', trans('global.inventory.fields.colour_range').'', ['class' => 'floating-label']) !!}

@if($errors->has('colour_range'))

{{ $errors->first('colour_range') }}

@endif
@foreach ($customer_groups as $group)
{!! Form::number('groups['.$group->id.'][price]', $item->customerGroups()->where('customer_group_id', $group->id)->first()->pivot->price ?? null, ['class' => 'form-control', 'step' => '0.01', 'id' => 'price_'.$group->id, 'required' => 'true']) !!} {!! Form::label('groups'.$group->id, 'Price for '.$group->group_name, ['class' => 'floating-label']) !!}

@if($errors->has('groups.'.$group->id.'.price'))

{{ $errors->first('groups.'.$group->id.'.price') }}

@endif
@endforeach
{!! Form::textarea('description', old('description'), ['class' => 'form-control']) !!} {!! Form::label('description', trans('global.inventory.fields.description').'', ['class' => 'floating-label']) !!}

@if($errors->has('description'))

{{ $errors->first('description') }}

@endif
{!! Form::button(trans('global.app_update'), ['class' => 'btn btn-info', 'type' => 'submit']) !!} {!! Form::close() !!}
@stop @section('javascript') @parent @stop