@extends('backend.layouts.app') @section('content') {{ html()->form('PUT' ,route('backend.plans.update', $data->id)) ->attribute('data-toggle', 'validator') ->attribute('id', 'form-submit') // Add the id attribute here ->class('requires-validation') // Add the requires-validation class ->attribute('novalidate', 'novalidate') // Disable default browser validation ->open() }}
{{ html()->label(__('plan.lbl_name') . ' *', 'name')->class('form-label') }} {{ html()->text('name') ->attribute('value', $data->name) ->placeholder(__('placeholder.lbl_plan_name')) ->class('form-control') ->attribute('required','required') }} @error('name') {{ $message }} @enderror
Name field is required
{{ html()->label(__('plan.lbl_level') . '*', 'level')->class('form-label') }} {{ html()->select('level', isset($plan) && $plan > 0 ? collect(range(1, $plan + 1))->mapWithKeys(fn($i) => [$i => 'Level ' . $i])->prepend(__('Select Level'), '')->toArray() : ['1' => 'Level 1'], old('level', $data->level ?? '') )->class('form-control select2')->id('level')->attribute('placeholder', __('placeholder.lbl_plan_level'))->attribute('required','required') }} @error('level') {{ $message }} @enderror
Level field is required
{{ html()->label(__('plan.lbl_duration') . '*', 'duration')->class('form-label') }} {{ html()->select('duration', [ '' => __('messages.lbl_select_duration'), 'week' => 'Week', 'month' => 'Month', 'year' => 'Year' ], $data->duration) ->class('form-control select2') ->id('duration') ->attribute('placeholder', __('placeholder.lbl_plan_duration_type')) ->attribute('required','required') }} @error('duration') {{ $message }} @enderror
Duration field is required
{{ html()->label(__('plan.lbl_duration_value') . '*', 'duration_value')->class('form-label') }} {{ html()->input('number', 'duration_value', $data->duration_value) ->class('form-control') ->id('duration_value') ->attribute('placeholder', __('placeholder.lbl_plan_duration_value')) ->attribute('oninput', "this.value = Math.abs(this.value)") // ->attribute('min', '1') ->attribute('required','required') }} @error('duration_value') {{ $message }} @enderror
Duration Value field is required
{{ html()->label(__('plan.lbl_amount') . '*', 'price')->class('form-label') }} {{ html()->input('number', 'price', $data->price) ->class('form-control') ->id('price') ->attribute('step', '1') ->attribute('placeholder', __('placeholder.lbl_plan_price')) ->attribute('oninput', "this.value = Math.abs(this.value)") // ->attribute('min', '0') ->attribute('required','required') }} @error('price') {{ $message }} @enderror
Price field is required
{{ html()->label(__('plan.lbl_discount'), 'discount')->class('form-label') }}
{{ html()->label(__('messages.active'), 'discount')->class('form-label mb-0 text-body') }}
{{ html()->hidden('discount', 0) }} {{ html()->checkbox('discount', old('discount', $data->discount)) ->class('form-check-input') ->id('discount-toggle') }}
@error('discount') {{ $message }} @enderror
@if($purchaseMethodEnabled)
{{ html()->label(__('messages.lbl_android_identifier') . '*', 'android_identifier')->class('form-label') }} {{ html()->text('android_identifier', old('android_identifier', $data->android_identifier ?? '')) ->class('form-control') ->id('android_identifier') ->attribute('placeholder', __('messages.lbl_android_identifier')) ->attribute('required','required') }} @error('android_identifier') {{ $message }} @enderror
Android Identifier field is required
{{ html()->label(__('messages.lbl_apple_identifier') . '*', 'apple_identifier')->class('form-label') }} {{ html()->text('apple_identifier', old('apple_identifier', $data->apple_identifier ?? '')) ->class('form-control') ->id('apple_identifier') ->attribute('placeholder', __('messages.lbl_apple_identifier')) ->attribute('required','required') }} @error('apple_identifier') {{ $message }} @enderror
Apple Identifier field is required
@endif
{{ html()->label(__('plan.lbl_status'), 'status')->class('form-label') }}
{{ html()->label(__('messages.active'), 'status')->class('form-label mb-0 text-body') }}
{{ html()->hidden('status', 0) }} {{ html()->checkbox('status',$data->status ) ->class('form-check-input') ->id('status') }}
@error('status') {{ $message }} @enderror
{{ html()->label(__('plan.lbl_discount_percentage') . '*', 'discount_percentage')->class('form-label') }} {{ html()->input('number', 'discount_percentage', old('discount_percentage', $data->discount_percentage ?? 0)) ->class('form-control') ->id('discount_percentage') ->attribute('min', '0') ->attribute('max', '99') ->attribute('placeholder', __('plan.enter_discount_percentage')) }} @error('discount_percentage') {{ $message }} @enderror
{{ html()->label(__('plan.lbl_total_price'), 'total_price')->class('form-label') }} {{ html()->input('number', 'total_price', old('total_price', $data->total_price)) ->class('form-control') ->id('total_price') ->attribute('step', '0.01') ->attribute('placeholder', __('plan.lbl_total_price')) ->attribute('readonly', 'readonly') }} @error('total_price') {{ $message }} @enderror
Total price field is required
{{ html()->label(__('plan.lbl_description') . '*', 'description')->class('form-label') }} {{ html()->textarea('description', $data->description) ->placeholder(__('placeholder.lbl_plan_limit_description')) ->class('form-control') ->attribute('required','required') }} @error('description') {{ $message }} @enderror
Description field is required
@if(!empty($planLimits))
{{ __('plan.lbl_plan_limits') }}
@endif
@foreach($planLimits as $planLimit)
id}.value", $planLimit->limitation_value) ? 'checked' : '' }} onchange="toggleQualitySection()">
@error("limits.{$planLimit->id}.value") {{ $message }} @enderror
@if($planLimit->limitation_slug == 'device-limit')
{{ html()->label(__('plan.lbl_device_limit'), 'device_limit_value')->class('form-label') }} {{ html()->input('number', 'device_limit_value', old('device_limit_value', $planLimit->limit)) ->class('form-control') ->id('device_limit_value') ->attribute('placeholder', __('placeholder.lbl_device_limit')) ->attribute('value', $planLimit->limit ?? '0') }} @error('device_limit_value') {{ $message }} @enderror
Device Limit field is required
@endif @if($planLimit->limitation_slug == 'download-status')
@php $downloadOptions = json_decode($planLimit->limit, true) ?? []; @endphp @foreach($downloadoptions as $option)
value]) && $downloadOptions[$option->value] == "1") ? 'checked' : '' }}>
@endforeach
@endif @if($planLimit->limitation_slug == 'profile-limit')
{{ html()->label(__('plan.lbl_profile_limit'), 'profile_limit_value')->class('form-label') }} {{ html()->input('number', 'profile_limit_value', old('profile_limit_value', $planLimit->limit)) ->class('form-control') ->id('profile_limit_value') ->attribute('placeholder', __('placeholder.lbl_device_limit')) ->attribute('value', $planLimit->limit ?? '0') }} @error('profile_limit_value') {{ $message }} @enderror
Profile Limit field is required
@endif @if($planLimit->limitation_slug =='supported-device-type')
@foreach(['tablet', 'laptop', 'mobile'] as $option)
@endforeach
@endif @endforeach
{{ html()->submit(trans('messages.save'))->class('btn btn-md btn-primary float-right')->id('submit-button') }}
{{ html()->form()->close() }} @endsection @push('after-scripts') @endpush