@php $title = $page['title']; $bodyClass = ''; $mainClass = ''; $contentClass = 'portal-content--template-library'; $templateRows = $templateRows ?? collect(); $templateCount = $templateCount ?? $templateRows->count(); $approvedTemplateCount = $approvedTemplateCount ?? $templateRows->where('status', 'APPROVED')->count(); $templateMeta = $templateMeta ?? ['total' => $templateRows->count(), 'page' => 1, 'totalPages' => 1, 'merchants' => [], 'categories' => []]; $perPage = $perPage ?? 10; // Only admins and resellers can see more than one account, so only they get the account filter. $showAccountFilter = count($templateMeta['merchants']) > 1; $merchantNames = collect($templateMeta['merchants'])->mapWithKeys(fn ($m) => [$m['merchant_id'] => ($m['name'] ?? '') ?: $m['merchant_id']])->all(); $navMenus = \App\Support\PortalNavigation::menus(); $activeNav = 'wa-business'; $activeSubnav = 'wa-campaign-template'; $activeStatusTab = strtolower(trim((string) request('status', 'all'))); $allTabQuery = request()->except(['status', 'page']); $approvedTabQuery = [...$allTabQuery, 'status' => 'approved']; @endphp @extends('layouts.portal') @section('content')

Template Message

+ Create Template
@if (session('status'))
Berhasil

{{ session('status') }}

@endif
$activeStatusTab !== 'approved', ])> All {{ $templateCount }} $activeStatusTab === 'approved', ])> Approved {{ $approvedTemplateCount }}
@if ($activeStatusTab === 'approved') @endif @if ($showAccountFilter) @endif
@if ($showAccountFilter) @endif @forelse ($templateRows as $row) @if ($showAccountFilter) @endif @empty @endforelse
Template NameAccountTime Added Category Language Status
@if (!empty($row['gw_template_id']) || !empty($row['name'])) {{ $row['name'] }} @elseif (!empty($row['id'])) {{ $row['name'] }} @else {{ $row['name'] }} @endif {{ $merchantNames[$row['merchant_id'] ?? ''] ?? ($row['merchant_id'] ?? '-') }} {{ $row['display_name'] ?? '' }} {{ $row['createDatetime']->format('d M Y') }} {{ $row['createDatetime']->format('H:i') }} WIB {{ $row['category'] }} {{ $row['language'] }} {{ \Illuminate\Support\Str::limit($row['body'] ?? '-', 80) }} @php($templateStatus = strtoupper(trim((string) ($row['status'] ?? '')))) in_array($templateStatus, ['PENDING', 'WAITING'], true), 'template-library-status--reject' => in_array($templateStatus, ['REJECT', 'REJECTED'], true), ])>{{ $row['status'] }}
Belum ada template iklan.
@if ($templateMeta['totalPages'] > 1) @php($currentPage = $templateMeta['page']) @endif
@endsection @if (session('status')) @push('scripts') @endpush @endif