@php $remark = $user[0]['remark']; $profile = $user[0]['rprofile']['name']; $nickname = \App\Models\Company::where('group_id',auth()->user()->id_group)->select('nickname')->first()->nickname; $i = 1; @endphp @foreach ($user as $item) @php Carbon\Carbon::setLocale('id'); if ($item->rprofile->validity === 'Unlimited') { $validity = 'Unlimited'; } else { if($item->rprofile->validity >= 2592000){ $validity = Carbon\CarbonInterval::seconds((int)$item->rprofile->validity) ->cascade() ->forHumans([ 'skip' => ['day','hour','minute','second'], ]); }else{ $validity = Carbon\CarbonInterval::seconds((int)$item->rprofile->validity) ->cascade() ->forHumans(); } } if ($item->rprofile->uptime === 'Unlimited') { $uptime = 'Unlimited'; } else { if($item->rprofile->uptime >= 2592000){ $uptime = Carbon\CarbonInterval::seconds((int)$item->rprofile->uptime) ->cascade() ->forHumans([ 'skip' => ['day','hour','minute','second'], ]); }else{ $uptime = Carbon\CarbonInterval::seconds((int)$item->rprofile->uptime) ->cascade() ->forHumans(); } } $precision = 2; if ($item->rprofile->quota === 'Unlimited') { $quota = 'Unlimited'; } else { $base = log($item->rprofile->quota) / log(1024); $suffixes = [' bytes', ' KB', ' MB', ' GB', ' TB']; $quota = round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)]; } if ($item->rprofile->price === 0) { $price = 0; } else { $price = number_format($item->rprofile->price, 0, '.', '.'); } @endphp