// PHP Integration

AI ready structured data for
PHP.

PHP powers over 75% of the web – from custom applications to frameworks like Laravel, Symfony, and legacy systems. Whether you’re running a homegrown CMS, a custom e-commerce platform, or any PHP-based website, enhancely brings AI-powered structured data to your stack.

enhancely automatically generates the right JSON-LD (schema.org) for each page—no manual markup, no brittle scripts.

graph LR
  A["Browser Request"] --> B["PHP Application"]
  B --> C["enhancely-php Client"]
  C --> D["enhancely API"]
  D --> E["JSON-LD"]
  E --> C
  C --> F["ETag Cache"]
  F --> C
  B --> G["HTML + JSON-LD"]
Fig. 1 — PHP integration with ETag-based caching
// How it works

Require. Call. Done.

The enhancely PHP package works with any PHP framework or custom code.
01

Send URL

Your PHP code sends the current page URL to the enhancely API.
02

Receive JSON-LD

enhancely returns ready-made JSON-LD for that URL.
03

Output

The client outputs it as <script type="application/ld+json"> in your HTML.
04

ETag Caching

Built-in ETag support prevents repeated fetches.
// Features

What you get.

PHP
Any Framework
Works with Laravel, Symfony, WordPress, Kirby, or any custom PHP code.
ET
ETag Caching
Built-in ETag-based caching to minimize API calls. Recommended for production.
1
One Function Call
Get JSON-LD for the current page with a single function call. That's it.
// Getting started

Quick setup.

01
Install via Composer
composer require enhancely/enhancely-php
02
Set API key
Via environment variable or runtime configuration
03
Call enhancely
$resp = \Enhancely\Client::jsonld(); echo $resp;

Installation

composer require enhancely/enhancely-php

Basic usage

<?php

require_once __DIR__ . '/vendor/autoload.php';

// Get JSON-LD for current page (auto-detects URL from $_SERVER)
$resp = \Enhancely\Client::jsonld();

if ($resp->ready()) {
    echo $resp; // outputs <script type="application/ld+json">...</script>
}

Caching with ETags

<?php

$prevEtag = $cache->get('enhancely_etag_' . md5($url));
$resp = \Enhancely\Client::jsonld(url: $url, etag: $prevEtag);

if ($resp->notModified()) {
    echo $cache->get('enhancely_data_' . md5($url));
} elseif ($resp->ready()) {
    $cache->set('enhancely_etag_' . md5($url), $resp->etag());
    $cache->set('enhancely_data_' . md5($url), strval($resp));
    echo $resp;
}

Framework examples

Laravel

$jsonld = \Enhancely\Client::jsonld(url: request()->url());

if ($jsonld->ready()) {
    view()->share('jsonld', strval($jsonld));
}

Symfony

$jsonld = \Enhancely\Client::jsonld(url: $request->getUri());

WordPress (custom theme)

add_action('wp_head', function() {
    $resp = \Enhancely\Client::jsonld(url: get_permalink());
    if ($resp->ready()) {
        echo $resp;
    }
});

Compatibility & Requirements

PHP: >= 8.2

Dependencies: Composer

Frameworks: Any (Laravel, Symfony, WordPress, custom, etc.)

// FAQ

PHP & enhancely
FAQ.

Install the enhancely PHP SDK via Composer with a single command. Add one function call in your page template's section — the SDK handles the API request, ETag-aware caching, and JSON-LD output automatically. The SDK works with any PHP setup — Laravel, Symfony, WordPress custom themes, or plain PHP applications. Requires PHP 8.2+ and Composer. No additional dependencies, no database configuration, no build step.
Yes. The enhancely PHP SDK integrates with any PHP framework. For Laravel, add the function call in your Blade layout template. For Symfony, add it in your Twig base template. For WordPress custom themes, add it in header.php. The SDK follows PSR standards, requires only Composer as a dependency, and includes framework-specific examples in the documentation. ETag-aware caching is built in to minimize API requests regardless of your framework choice.
Every piece of markup passes through a 3-layer curation pipeline before deployment. Layer 1 (Validity) checks against the full Schema.org specification — all 806 types, every property, every value range. Layer 2 (Factuality) cross-references structured data against your actual page content — no hallucinated data, no invented prices, no phantom opening hours. Layer 3 (Compliance) verifies Rich Result eligibility against Google, Bing, and AI search engine guidelines. Peer-reviewed research (Dang et al., Semantic Web Journal, IOS Press, 2025) showed that without such a pipeline, 40–50% of AI-generated markup is invalid or non-compliant.
Yes. Multiple JSON-LD blocks on a single page are valid and supported by all major search engines — Google, Bing, and others evaluate and merge all structured data blocks they find. enhancely adds additional, validated markup without conflicting with or overwriting your existing schema. If enhancely detects invalid or outdated markup from other sources, Schema Healing can automatically identify and repair it — so legacy schema from previous tools or manual implementations gets fixed and kept current.

Stop leaving
bots hungry.

Your content is already great for humans. Let us make it perfect for bots.