@extends('layouts.app') @section('title','Meta Integration') @section('header','Meta Integration') @section('content')<div class="row"><div><h1>Facebook & Instagram Lead Integration</h1><p>Connect Meta directly to HIGHRA CRM.</p></div>@if(!$connection)<a class="btn" href="/meta/connect">Connect Meta</a>@endif</div><div class="panel">@if($connection)<h2>Connected: {{$connection->meta_user_name}}</h2><p>Status: {{$connection->status}}</p>@foreach($connection->pages as $p)<div class="page"><b>{{$p->name}}</b><span>{{$p->subscribed?'Webhook enabled':'Ready to subscribe'}}</span>@if(!$p->subscribed)<form method="post" action="/meta/pages/{{$p->id}}/subscribe">@csrf<button class="btn">Enable Lead Webhook</button></form>@endif <a href="/meta/pages/{{$p->id}}/forms">Forms JSON</a></div>@endforeach @else<h2>Not Connected</h2><p>Set META_APP_ID and META_APP_SECRET in .env, then connect Meta.</p>@endif</div><div class="panel"><h2>Webhook Endpoint</h2><code>{{url('/api/webhooks/meta')}}</code><p>Use the same META_VERIFY_TOKEN in Meta App webhook settings.</p></div>@endsection
