How jrwebdeveloper1/meta-lead-ingester works
Purpose and Integration Surface
A standalone Laravel package that receives real-time Meta Lead Ads and Google Ads Lead Form webhooks, verifies them, queues ingestion, and persists normalized provider-specific lead records. The package is integrated through Composer, its service provider, published configuration/migrations, and package-owned API/web routes.
Key paths: src/MetaLeadIngesterServiceProvider.php, config/meta-lead-ingester.php, routes/api.php.
HTTP Entry Points
Webhook endpoints are registered through the package API routes. Meta uses a webhook controller for verification/event intake; Google uses a dedicated controller. A separate web dashboard route/controller exposes stored lead/account information through Blade views.
Key paths: routes/api.php, src/Http/Controllers/WebhookController.php, src/Http/Controllers/GoogleWebhookController.php, routes/web.php, src/Http/Controllers/Web/DashboardController.php.
Provider Authentication Boundary
Incoming requests are authenticated before ingestion. Meta requests pass through HMAC-signature validation using the configured app secret. Google requests use a provider/account key mechanism, with account records serving as the trusted configuration boundary. Invalid or unauthenticated webhooks should not reach asynchronous processing.
Key paths: src/Http/Middleware/VerifyMetaSignature.php, src/Http/Middleware/VerifyGoogleSignature.php, src/Models/MetaAccount.php, src/Models/GoogleAccount.php.
Asynchronous Ingestion Pipeline
Controllers accept verified webhook payloads and dispatch provider-specific Laravel queue jobs. This decouples webhook response latency from lead retrieval/persistence and allows the configured queue connection/name to govern execution. Meta processing fetches lead details after receiving an event reference; Google processing saves its submitted lead-form payload through its own job path.
Key paths: src/Jobs/ProcessMetaLeadJob.php, src/Jobs/ProcessGoogleLeadJob.php, config/meta-lead-ingester.php.
Persistence Model
The package maintains separate account and lead tables/models for each provider rather than forcing a shared schema. Account records hold provider-specific credentials or identifiers; lead records preserve ingested lead data and provider association. Database migrations are publishable and run in the host Laravel application.
Key paths: database/migrations/2026_01_01_000000_create_meta_accounts_table.php, database/migrations/2026_01_01_000001_create_meta_leads_table.php, database/migrations/2026_01_01_000002_create_google_accounts_table.php, database/migrations/2026_01_01_000003_create_google_leads_table.php.
Meta External-Service Flow
Meta sends a webhook event to the package endpoint. After HMAC validation, the Meta job uses Meta/Graph API configuration—including API version and app secret—to obtain lead details, then writes a MetaLead associated with a MetaAccount. This is the principal outbound external-service boundary.
Key paths: src/Http/Controllers/WebhookController.php, src/Jobs/ProcessMetaLeadJob.php, src/Models/MetaLead.php, src/Models/MetaAccount.php.
Runtime and Presentation
The package runs inside a host Laravel application, requiring Laravel routing, middleware, Eloquent/database migrations, and a queue worker for reliable background processing. Its optional server-rendered dashboard is a conventional Blade presentation layer over the persisted ingestion data, not the lead-ingestion path itself.
Key paths: resources/views/dashboard.blade.php, resources/views/layout.blade.php, src/Http/Controllers/Web/DashboardController.php.
Components 16
Host Laravel Runtime
- Host Laravel App · Provides routing, Eloquent, queues, and database runtime.
- Package Service Provider
src/MetaLeadIngesterServiceProvider.php - Package Configuration · Defines provider and queue settings.
config/meta-lead-ingester.php
Package HTTP Surface
- Webhook API Routes
routes/api.php - Meta Webhook Controller · Handles verification and event intake.
src/Http/Controllers/WebhookController.php - Google Webhook Controller
src/Http/Controllers/GoogleWebhookController.php - Meta HMAC Verification
src/Http/Middleware/VerifyMetaSignature.php - Google Account-Key Verification
src/Http/Middleware/VerifyGoogleSignature.php - Dashboard Web Route
routes/web.php - Lead Dashboard · Optional presentation over persisted provider data.
src/Http/Controllers/Web/DashboardController.php
Async Ingestion
- Process Meta Lead · Fetches lead details after webhook acceptance.
src/Jobs/ProcessMetaLeadJob.php - Process Google Lead · Persists submitted lead-form payloads.
src/Jobs/ProcessGoogleLeadJob.php - Meta Graph API
Provider Data
- Meta Accounts & Leads · Accounts hold credentials; leads retain provider data.
src/Models/MetaLead.php - Google Accounts & Leads · Accounts are the Google trust boundary.
src/Models/GoogleAccount.php - Publishable Migrations · Creates separate Meta and Google account/lead tables.
database/migrations/2026_01_01_000000_create_meta_accounts_table.php
Connections 23
- Host Laravel App → Package Service Provider: boots
- Package Service Provider → Package Configuration: loads
- Package Service Provider → Webhook API Routes: registers
- Package Service Provider → Dashboard Web Route: registers
- Package Service Provider → Publishable Migrations: publishes
- Webhook API Routes → Meta HMAC Verification: Meta endpoint
- Webhook API Routes → Google Account-Key Verification: Google endpoint
- Meta HMAC Verification → Meta Webhook Controller: verified requests
- Google Account-Key Verification → Google Webhook Controller: authenticated requests
- Meta Webhook Controller → Process Meta Lead: dispatches
- Google Webhook Controller → Process Google Lead: dispatches
- Package Configuration → Process Meta Lead: queue and API settings
- Package Configuration → Process Google Lead: queue settings
- Process Meta Lead → Meta Graph API: fetches lead details
- Process Meta Lead → Meta Accounts & Leads: writes lead
- Process Google Lead → Google Accounts & Leads: writes lead
- Meta HMAC Verification → Meta Accounts & Leads: validates account context
- Google Account-Key Verification → Google Accounts & Leads: validates account key
- Publishable Migrations → Meta Accounts & Leads: creates tables
- Publishable Migrations → Google Accounts & Leads: creates tables
- Dashboard Web Route → Lead Dashboard: serves
- Lead Dashboard → Meta Accounts & Leads: reads
- Lead Dashboard → Google Accounts & Leads: reads