@extends('layouts.subscriptions') @push('style') @endpush @section('content') @php $selectedBillingCycle = old('billing_cycle', 'subscribe'); $selectedBillingCycle = in_array($selectedBillingCycle, ['subscribe', 'one_month'], true) ? $selectedBillingCycle : 'subscribe'; $selectedPaymentMethod = old('payment_method', $selectedBillingCycle === 'one_month' ? 'card_networks' : 'credit_card'); $serviceDescription = trim((string) ($subscription->service?->description ?? '')); if ($serviceDescription === '') { $serviceDescription = trim((string) (\App\Models\Service::query() ->where('name', $subscription->service?->name) ->whereNotNull('description') ->where('description', '!=', '') ->value('description') ?? '')); } if ($serviceDescription === '') { $serviceDescription = trim((string) (\App\Models\Service::query() ->where('category_id', $subscription->service?->category_id) ->where(function ($q) use ($subscription) { $name = strtolower(trim((string) ($subscription->service?->name ?? ''))); $q->whereRaw('LOWER(name) = ?', [$name]); }) ->whereNotNull('description') ->where('description', '!=', '') ->value('description') ?? '')); } @endphp