{{ $pageTitle ?? __('messages.list') }}
@if($auth_user->can('coupon list')) {{ __('messages.back') }} @endif
{{ Form::model($coupondata,['method' => 'POST','route'=>'coupon.store', 'data-toggle'=>"validator" ,'id'=>'coupon'] ) }} {{ Form::hidden('id') }}
{{ Form::label('code',__('messages.code').' *',['class'=>'form-control-label'], false ) }} @if( $coupondata->id == null ) {{ Form::text('code',old('code'),['placeholder' => __('messages.code'),'class' =>'form-control','required']) }} @else

{{ $coupondata->code }}

@endif
{{ Form::label('discount_type',__('messages.discount_type').' *',['class'=>'form-control-label'],false) }} {{ Form::select('discount_type',['fixed' => __('messages.fixed') , 'percentage' => __('messages.percentage') ],old('status'),[ 'class' =>'form-control select2js','required']) }}
{{ Form::label('discount',__('messages.discount').' *',['class'=>'form-control-label'],false) }} {{ Form::number('discount',null, [ 'min' => 0, 'step' => 'any' , 'placeholder' => __('messages.discount'),'class' =>'form-control','required']) }}
{{ Form::label('expire_date',__('messages.expire_date').' *',['class'=>'form-control-label'], false ) }} {{ Form::text('expire_date',old('expire_date'),['placeholder' => __('messages.expire_date'),'class' =>'form-control datetimepicker','required']) }}
{{ Form::label('name', __('messages.select_name',[ 'select' => __('messages.service') ]).' *',['class'=>'form-control-label'],false) }}
@php $assigned_service = $coupondata->serviceAdded->mapWithKeys(function ($item) { return [$item->service_id => optional($item->service)->name]; }); @endphp {{ Form::select('service_id[]', $assigned_service, $coupondata->serviceAdded->pluck('service_id'), [ 'class' => 'select2js form-group service', 'required', 'multiple' => 'multiple', 'data-placeholder' => __('messages.select_name',[ 'select' => __('messages.service') ]), 'data-ajax--url' => route('ajax-list', ['type' => 'service-list']), ]) }}
{{ Form::label('status',__('messages.status').' *',['class'=>'form-control-label'],false) }} {{ Form::select('status',['1' => __('messages.active') , '0' => __('messages.inactive') ],old('status'),[ 'id' => 'role' ,'class' =>'form-control select2js','required']) }}
{{ Form::submit( __('messages.save'), ['class'=>'btn btn-md btn-primary float-right']) }} {{ Form::close() }}