@extends('admin::layouts.app') @section('title', '{{ $template->name }} — Admin') @section('content')

{{ $template->name }}

{{ $template->business->name ?? 'Unknown Business' }} · {{ $template->category }} · {{ $template->language }}

{{ $template->status }}
@if(session('success')) @endif @if(session('error')) @endif
{{-- Left: Edit form --}}
@if($template->status === 'REJECTED' && $template->rejection_reason)
Rejected by Meta: {{ $template->rejection_reason }}
@endif
@csrf @method('PUT') {{-- Basic Info --}}
Basic Info
@error('name')
{{ $message }}
@enderror
@error('category')
{{ $message }}
@enderror
@error('language')
{{ $message }}
@enderror
{{-- Header --}}
Header — optional TEXT
@error('header_text')
{{ $message }}
@enderror @if(!empty($template->header_examples))
@endif
{{-- Body --}}
Body *
@error('body')
{{ $message }}
@enderror @if(!empty($template->body_examples))

Variable examples:

@foreach($template->body_examples as $i => $ex)
@endforeach
@endif
{{-- Footer --}}
Footer — optional
@error('footer')
{{ $message }}
@enderror
{{-- Buttons --}}
Buttons — optional
@if(!empty($template->buttons)) @foreach($template->buttons as $i => $btn)
@if(!empty($btn['url']))
@endif
@endforeach @else

No buttons on this template.

@endif
{{-- Admin Notes --}}
Admin Notes
Cancel
{{-- Right: Actions + Meta info --}}
{{-- Submit to Meta --}} @if($template->status === 'DRAFT')
Submit to Meta

Once you're satisfied with this template, submit it to Meta's WhatsApp Cloud API using the business's credentials. The status will change to PENDING.

@csrf
@endif {{-- Refresh status --}} @if($template->status !== 'DRAFT')
Sync Status

Fetch the latest approval status from Meta.

@csrf
@endif {{-- Meta Details --}}
Details
Business
{{ $template->business->name ?? '—' }}
Category
{{ $template->category }}
Language
{{ $template->language }}
@if($template->meta_template_id)
Meta ID
{{ $template->meta_template_id }}
@endif @if($template->submitted_at)
Submitted
{{ $template->submitted_at->format('d M Y, H:i') }}
@endif
Created
{{ $template->created_at->format('d M Y') }}
@endsection