@extends('layouts.app') @section('title', __('superadmin::lang.superadmin') . ' | Coupon') @section('content') @include('superadmin::layouts.nav')
@lang('superadmin::lang.edit_coupon')

{!! Form::model($coupon, [ 'url' => action( [\Modules\Superadmin\Http\Controllers\CouponController::class, 'update'], ['coupon' => $coupon->id], ), 'method' => 'put', 'id' => 'edit_coupon', ]) !!}
{!! Form::label('coupon_code', __('superadmin::lang.coupon_code') . ':') !!} {!! Form::text('coupon_code', $coupon->coupon_code, [ 'class' => 'form-control bd-rd-7', 'placeholder' => '', 'required', ]) !!}
{!! Form::label('discount_type', __('superadmin::lang.discount_type') . ':') !!} {!! Form::select('discount_type', $discount_types, $coupon->discount_type, [ 'class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'required', ]) !!}
{!! Form::label('discount', __('superadmin::lang.discount') . ':') !!} {!! Form::number('discount', $coupon->discount, [ 'class' => 'form-control bd-rd-7', 'placeholder' => '', 'required', 'step' => '0.01' ]) !!}
{!! Form::label('expiry_date', __('superadmin::lang.expiry_date') . ':') !!} {!! Form::text('expiry_date', !empty($coupon->expiry_date) ? @format_date($coupon->expiry_date) : null, [ 'class' => 'form-control bd-rd-7', 'placeholder' => '', 'readonly', 'id' => 'expiry_date', ]) !!}
{!! Form::label('applied_on_packages', __('superadmin::lang.applied_on_packages') . ':') !!} {!! Form::select('applied_on_packages[]', $packages, json_decode($coupon->applied_on_packages), [ 'class' => 'form-control select2', 'multiple', ]) !!} @lang('superadmin::lang.applied_on_packages_help_text')
{!! Form::label('applied_on_business', __('superadmin::lang.applied_on_business')) !!} {!! Form::select('applied_on_business[]', $businesses, json_decode($coupon->applied_on_business), [ 'class' => 'form-control select2', 'multiple', ]) !!} @lang('superadmin::lang.applied_on_business_help_text')

{!! Form::submit(__('messages.update'), ['class' => 'btn btn-warning btn-big']) !!}
{!! Form::close() !!}
@endsection @section('javascript') @endsection