- Is takeit/amp-html-bundle compatible with Laravel?
- No. It is a Symfony2/Symfony3 bundle built around Symfony's DI container, a kernel.response event subscriber, a Twig extension, and a bundle configuration tree. None of those integration points map onto Laravel's service container, middleware pipeline, or Blade templates, so there is no drop-in installation path. You would need to port the conversion logic into a Laravel service provider and response middleware.
- Can I install takeit/amp-html-bundle with Composer in a Laravel project?
- Composer may resolve it, but it will not function correctly in Laravel. The bundle expects Symfony framework primitives and bundle registration in AppKernel, which Laravel does not provide. Even if it loads, nothing wires its response listener or Twig extension into the Laravel request lifecycle. Treat the source as a reference implementation rather than a dependency.
- What does takeit/amp-html-bundle actually do?
- It adds AMP HTML conversion to Symfony applications by swapping the response body through a kernel.response event subscriber. It also ships AMP-aware routing conventions, Twig helpers, theme support, and bundle configuration for the converter options. Underneath, it wraps a thin HTML-to-AMP conversion layer, almost certainly the lullabot/amp library.
- Does takeit/amp-html-bundle support PHP 8.2 or PHP 8.3?
- Unlikely. The package targets the Symfony 2.x and 3.x era, and its code predates modern PHP typing, so expect deprecations or hard failures on PHP 8.2 and 8.3. There has been no release since March 2019, so no compatibility work has been done. Check the composer.json PHP constraint before assuming anything will load.
- How do I add AMP support to a Laravel application instead?
- Bind a converter as a singleton in a service provider, expose its options in config/amp.php, and rewrite the response body in a middleware or response macro keyed on ?amp, an amp subdomain, or Accept negotiation. Add a Blade directive or view composer for AMP boilerplate and make canonical pages emit a link rel=amphtml back-reference. Register AMP routes explicitly with a route group or subdomain rather than reusing Symfony routing conventions.
- Is takeit/amp-html-bundle still maintained?
- No. It has roughly 32 stars, zero dependents, a single maintainer, and no release since March 2019. The underlying AMP converter it wraps is also unmaintained. Treat it as abandoned and plan accordingly if you need bug fixes for modern HTML.
- Can I use the bundle's Twig AMP helpers in Laravel Blade?
- No, Twig functions do not exist in Blade. You would need to reimplement the helpers as a Blade directive, a view composer, or plain PHP helpers that inject AMP boilerplate, amp-img markup, and the amphtml link element. This is usually a small amount of code, but it is code you own.
- What are the alternatives to takeit/amp-html-bundle for Laravel?
- Depend directly on a maintained HTML-to-AMP converter or a fork and write your own Laravel service provider and middleware. Other options include running the Node amp-toolbox as a sidecar service, calling a hosted conversion API, or skipping AMP in favor of plain fast HTML. Check maintenance status carefully, since the original lullabot/amp library is abandoned.
- Is AMP still worth implementing in 2025?
- AMP's strategic value has eroded: Google removed the AMP requirement for Top Stories in 2021 and dropped AMP as a page-experience signal. Committing architecture to AMP now needs an explicit justification such as AMP for Email, a specific distribution channel, or a legacy contract. For most Laravel apps, fast standards-based HTML delivers the same user benefits with less lock-in.
- How do I validate AMP output and test it in a Laravel pipeline?
- Run the official AMP validator against rendered responses in a feature test, asserting required boilerplate, the amp attribute on the html element, and the canonical/amphtml link pair. Snapshot-test the middleware output for a few representative routes so converter regressions are caught early. If you use a Node amp-toolbox sidecar, its validator can be invoked from CI alongside your PHP test suite.