@extends('layouts.app') @section('content') @php $translationLanguages = ($appLanguages ?? collect()) ->filter(fn ($language) => filled($language->code)) ->values(); $planTranslations = $plan->translations->keyBy(fn ($t) => strtolower($t->locale)); @endphp

@if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @php $featuresInput = old('features', $plan->features ?? []); if (!is_array($featuresInput)) { $featuresInput = []; } $features = []; foreach ($featuresInput as $item) { $value = is_array($item) ? ($item['feature'] ?? '') : $item; $value = trim((string) $value); if ($value !== '') { $features[] = $value; } } if (count($features) === 0) { $features = ['']; } @endphp
Edit Subscription Plan

Update plan details.

@csrf @method('PUT')
@error('name')
{{ $message }}
@enderror
@error('regular_price')
{{ $message }}
@enderror
@error('sale_price')
{{ $message }}
@enderror
@error('duration_days')
{{ $message }}
@enderror
@php $status = old('status', $plan->status ?? 'active'); @endphp @error('status')
{{ $message }}
@enderror
@error('short_description')
{{ $message }}
@enderror
Features
Add plan highlights here.
@foreach ($features as $feature)
@endforeach
@error('features')
{{ $message }}
@enderror @error('features.*.feature')
{{ $message }}
@enderror
@if($translationLanguages->count())
Translations

Manual translation fields. Default locale: {{ strtoupper($defaultTranslationLocale) }}.

@include('includes.partial.auto_translate.edit_toggle')
@foreach($translationLanguages as $language) @php $locale = strtolower($language->code); $translation = $planTranslations->get($locale); $translationLanguageName = $language->language->name ?? ($language->data['name'] ?? strtoupper($language->code)); @endphp
@error('translations.' . $language->code . '.name')
{{ $message }}
@enderror
@error('translations.' . $language->code . '.short_description')
{{ $message }}
@enderror
@endforeach
@endif
Back
@endsection