lullabot/amp
Lullabot AMP is a PHP library that converts standard HTML into valid Accelerated Mobile Pages markup. It handles AMP-specific transformations and validation, helping PHP and Drupal projects serve faster, compliant mobile pages.
Architecture fit
lullabot/amp), framework-agnostic: HTML in, AMP HTML plus a validation report out. It has no opinion about routing, caching, or persistence, which is exactly what you want.AmpConverter) behind a dedicated route group, not middleware. Any design that wraps the whole response pipeline couples the app to a lossy rewriter and is the wrong shape.<html>/<head> and strips disallowed scripts. That is fine for server-rendered full pages, awkward for SPA/JSON delivery or already-cached fragments.Integration feasibility
loadHtml() → convertToAmpHtml() → getWarnings().amphtml-validator) via a bundled JS entry point. That is a new runtime dependency, not just a package. Slim PHP-FPM images and shared hosting will fail here.Technical risk
Key questions
Stack fit
AmpController.layouts/amp.blade.php plus Blade components (<x-amp-img>, <x-amp-youtube>) that emit compliant markup. Use the library as a safety net and warning source, not the primary authoring mechanism — fighting the converter is more expensive than writing correct markup.amp_cache table on (model_id, updated_at).Migration path
ValidateAmpJob fired on publish — never validate on the request path.<link rel="amphtml"> on canonical pages last, once error counts are zero.Compatibility
Sequencing
Maintenance
Support
Scaling
Failure modes
node binary → validation throws while conversion still succeeds. Default to log-and-alert, not request failure.Ramp-up
Bottom line: technically feasible and cheap to start, but the value is narrowing as AMP's strategic relevance declines, the project is thinly maintained, and the license is unresolved. Treat it as a narrow, cached, asynchronous add-on — not a platform capability — and clear the business driver and legal questions before any engineering investment.
How can I help you explore Laravel packages today?