@php $subscription_enabled = Auth::user()->subscription_enabled ?? "0"; $subscription_data = Auth::user()->subscription_data ?? ""; $subscription_data = json_decode($subscription_data,true); if(isset($subscription_data['validity'])) $subscription_data['validity'] = $subscription_data['validity'].' '. __("Days"); $subscription_data['date'] = isset($subscription_data['time']) ? date("dS M Y",strtotime($subscription_data['time'])) : null; $validity = $subscription_data['validity'] ?? ''; $method = $subscription_data['method'] ?? ''; $package_id = $subscription_data['package_id'] ?? 0; $package_data = DB::table('packages')->select('package_name')->where('id',$package_id)->first(); $package_name = $package_data->package_name ?? ''; $package_name = $package_name; $currency_icons = get_country_iso_phone_currency_list('currency_icon'); $amount = ['title'=>__('Amount'),'value'=>0,'icon'=>'']; if(isset($subscription_data['amount']) && isset($subscription_data['currency'])){ $currency = $subscription_data['currency'] ?? 'USD'; $currency = $currency_icons[$currency] ?? $currency; $amount = $currency.$subscription_data['amount'].'/'.$validity; $amount = ['title'=>__('Price'),'value'=>$amount,'icon'=>'fas fa-coins text-warning']; } $subscription_data_formated = [ 'package_name' => ['title'=>__('Package'),'value'=>$package_name,'icon'=>'fas fa-shopping-bag text-primary'], 'amount' => $amount, 'method' => ['title'=>__('Method'),'value'=>$method ?? '','icon'=>'fas fa-credit-card text-primary'], 'date' => ['title'=>__('Subscribed at'),'value'=>$subscription_data['date'] ?? '','icon'=>'far fa-clock text-success'], ]; @endphp
@foreach($subscription_data_formated as $k => $data)
{!! $data['value'] ?? '' !!}
{!! $data['title'] ?? '' !!}
@endforeach