{{ $pageTitle ?? trans('messages.list') }}
{{ __('messages.back') }}
{{ html()->form('POST', route('plans.store'))->attribute('enctype', 'multipart/form-data')->attribute('data-toggle', 'validator')->id('plan')->open() }} {{ html()->hidden('id', $plan->id ?? '') }}
{{ html()->label(trans('messages.title') . ' *', 'title')->class('form-control-label') }} {{ html()->text('title', $plan->title ?? '')->placeholder(trans('messages.title'))->class('form-control')->required() }}
{{ html()->label(trans('messages.type') . ' *', 'type')->class('form-control-label') }} {{ html()->select('type', ['monthly' => __('messages.monthly'), 'yearly' => __('messages.yearly')], $plan->type ?? '')->id('type')->class('form-select select2js')->required() }}
{{ html()->label(trans('messages.duration') . ' *', 'duration')->class('form-control-label') }} {{ html()->select('duration', array_combine(range(1, 12), range(1, 12)), $plan->duration ?? 1)->id('duration')->class('form-select select2js')->required() }}
{{ html()->label(__('messages.amount') . ' *', 'amount')->class('form-control-label') }} {{ html()->number('amount', $plan->amount ?? 0)->placeholder(__('messages.amount'))->class('form-control')->required()->attribute('step', 'any')->attribute('min', 0) }}
{{ html()->label(trans('messages.status') . ' *', 'status')->class('form-control-label') }} {{ html()->select('status', ['1' => __('messages.active'), '0' => __('messages.inactive')], $plan->status ?? 1)->id('status')->class('form-select select2js')->required() }}
{{ html()->label(trans('messages.plan_limitation') . ' *', 'plan_type')->class('form-control-label') }}
@if($is_in_app_purchase_enable)
{{ html()->label(__('messages.playstore_identifier') . ' *', 'playstore_identifier')->class('form-control-label') }} {{ html()->text('playstore_identifier', $plan->playstore_identifier ?? '')->placeholder(__('messages.playstore_identifier'))->class('form-control')->required() }}
{{ html()->label(__('messages.appstore_identifier') . ' *', 'appstore_identifier')->class('form-control-label') }} {{ html()->text('appstore_identifier', $plan->appstore_identifier ?? '')->placeholder(__('messages.appstore_identifier'))->class('form-control')->required() }}
@endif
{{ html()->label(__('messages.description'), 'description')->class('form-control-label') }} {{ html()->textarea('description', $plan->description ?? '')->class('form-control textarea')->rows(3)->placeholder(__('messages.description')) }}
@foreach($plan_limit as $key => $value) @php $planValue = $plan->planlimit->plan_limitation ?? []; $isChecked = $planValue[$value->value]['is_checked'] ?? 'off'; $limitValue = $planValue[$value->value]['limit'] ?? null; @endphp
{{ html()->checkbox("plan_limitation[$value->value][is_checked]", $isChecked === 'on', 'on')->class('custom-control-input checklist')->id("enable_$value->value")->attribute('onClick', "showCheckLimitData('enable_$value->value')") }}
{{ html()->label(__('messages.limit'), 'service_limit')->class('form-control-label') }} {{ html()->number("plan_limitation[$value->value][limit]", $limitValue)->placeholder(__('messages.plan_limitations', ['keyword' => __('messages.' . $value->value)]))->class('form-control')->attribute('min', 0)->attribute('step', 'any') }}
@endforeach
{{ html()->label(__('messages.trial_period'), 'trial_period')->class('form-control-label') }} {{ html()->number('trial_period', $plan->trial_period ?? 0)->placeholder(__('messages.trial_period'))->class('form-control')->attribute('min', 0)->attribute('step', 'any') }}
{{ html()->submit(__('messages.save'))->class('btn btn-md btn-primary float-end') }} {{ html()->form()->close() }}
@section('bottom_script') @endsection