@foreach ($listapp as $list)
@php
$startDate = $list->start_at ? new DateTime($list->start_at) : null;
$months = [
'Jan' => 'Jan',
'Feb' => 'Feb',
'Mar' => 'Mar',
'Apr' => 'Apr',
'May' => 'Mei',
'Jun' => 'Jun',
'Jul' => 'Jul',
'Aug' => 'Agu',
'Sep' => 'Sep',
'Oct' => 'Okt',
'Nov' => 'Nov',
'Dec' => 'Des',
];
$dateLabel = $startDate ? strtr($startDate->format('M Y'), $months) : '-';
$appParts = array_map('trim', explode(' - ', (string) $list->appname, 2));
$department = strtolower($appParts[0] ?: 'Lainnya');
$category = strtolower($appParts[1] ?? ($list->title ?: 'Lainnya'));
$status = $list->flag_access == '1' ? 'online' : 'offline';
$searchText = strtolower(trim($list->title . ' ' . $list->appname . ' ' . $dateLabel));
$versionUrl =
substr($list->url, 0, 4) === 'http'
? $list->url . '/api/laravel-version?token=' . env('APPVERSION')
: URL::to($list->url . '/api/laravel-version?token=' . env('APPVERSION'));
$accessUrl =
substr($list->url, 0, 4) === 'http'
? $list->url . '/api/today-access-summary?token=' . env('APPVERSION')
: URL::to($list->url . '/api/today-access-summary?token=' . env('APPVERSION'));
$token = openssl_encrypt(
$list->username_app . ',' . $list->remember_token . ',' . date('d-m-Y'),
env('ALG'),
env('KEY'),
0,
env('SCR'),
);
$token = str_replace(['+', '/', '='], ['-', '_', '@'], $token);
if ($list->appid === 'msjapp') {
$versionUrl = URL::to('/api/laravel-version?token=' . env('APPVERSION'));
$accessUrl = URL::to('/api/today-access-summary?token=' . env('APPVERSION'));
}
if ($list->flag_access == '0') {
$versionUrl = '';
$accessUrl = '';
}
$appUrl =
$list->appid === 'msjapp'
? URL::to('/dashboard')
: (substr($list->url, 0, 4) === 'http'
? $list->url . '/auth/' . $token
: URL::to($list->url . '/auth/' . $token));
@endphp
 }})
{{--
--}}
{{ $list->title }}
{{ $list->appname }}
Mulai
{{ $dateLabel }}
v -
appid !== 'msjapp') target="_blank" @endif>
Buka aplikasi
@endforeach