@extends('layouts.app') @section('title', 'WhatsApp Templates') @push('style') @endpush @section('content') @php $routePrefix = strtolower(auth()->user()->role->name); $canManage = auth()->user()->hasPermissionName('whatsapp.templates.manage'); @endphp

Message Templates

Manage pre-approved WhatsApp Business message templates.
Back @if($canManage) @endif
@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@endif {{-- Category Filter --}}
Filter by category: @foreach(['All', 'Marketing', 'Utility', 'Authentication'] as $cat) @endforeach
@if($templates->isEmpty())

No templates yet

@if($canManage) Create your first template to get started. Templates must be approved by Meta before use. @else No approved templates available. Contact your company admin to add templates. @endif

@else
@foreach($templates as $tpl)
{{-- Header --}}
{{ $tpl->name }}
{{ $tpl->category }}
@if($tpl->status === 'APPROVED') Approved @elseif($tpl->status === 'PENDING') Pending @else Rejected @endif
{{-- Preview Bubble --}}
{{ $tpl->body }} @if($tpl->cta_text)
{{ $tpl->cta_text }}
@endif
{{-- Actions --}}
@if($tpl->status === 'APPROVED') @else @endif @if($canManage)
@csrf @method('DELETE')
@endif
@endforeach
@endif {{-- Create Template Modal --}} @if($canManage) @endif @endsection @push('script') @endpush