Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Twigx Bundle

Twigx Bundle Laravel Package

lmc/twigx-bundle

LMC TwigX Bundle integrates TwigX with Symfony to extend Twig templating capabilities, adding convenient template helpers and configuration for Symfony applications. Install via Composer and enable the bundle to build expressive, reusable views more easily.

View on GitHub
Deep Wiki
Context7

JSX like component syntax for Twig templating language

Frequently asked questions about Twigx Bundle
Is lmc/twigx-bundle compatible with Laravel?
No. lmc/twigx-bundle is a Symfony bundle that wires the TwigX Twig extension into Symfony's container and Twig rendering stack. It ships no Laravel service provider, facade, or Blade compiler integration, so it cannot be installed and enabled in a Laravel app the way a normal Composer package can. Laravel uses Blade by default, and the package's component syntax is implemented as a Twig lexer and node-visitor extension rather than a Blade feature.
How do I install lmc/twigx-bundle in a Laravel application?
You generally should not. Composer may download the code, but enabling it requires Symfony bundle registration and a Symfony dependency injection container, which Laravel does not provide. Any integration would mean either standing up Symfony container semantics inside Laravel or bypassing the bundle and registering alma/twigx directly on a standalone Twig environment. Neither path is a supported Laravel installation, and both add a second templating engine beside Blade. Use Laravel's native Blade components instead.
Does lmc/twigx-bundle provide a Laravel service provider or facade?
No. The repository is a Symfony bundle, so its integration points are Symfony bundle classes, DI service definitions, and Twig extension registration. There is no Laravel service provider, no facade, and no config file published through Laravel's package discovery. In a Laravel codebase you would have to write all of that glue yourself, and it would still depend on Symfony container behavior.
What does lmc/twigx-bundle actually do?
It integrates TwigX with Symfony's Twig rendering stack, registering TwigX services and Twig extensions in the Symfony container. TwigX adds JSX-like component syntax such as <Component prop={value}> to Twig templates via a lexer and token parser. The bundle's job is wiring, not the parser itself; the underlying syntax comes from alma/twigx. It is designed for Symfony applications that already render Twig templates.
Which Laravel and PHP versions does lmc/twigx-bundle support?
It does not publish a Laravel compatibility matrix because it is not a Laravel package. Its Composer constraints target Symfony and Twig versions, so Laravel version support is not applicable. Before considering any experimental use, check the package's composer.json and CI matrix for the exact PHP, Symfony, and Twig versions actually tested. Twig parser extensions are sensitive to minor Twig releases, so pinning Twig explicitly is essential.
Can I use TwigX component syntax in Laravel Blade templates?
No. TwigX is implemented as a Twig lexer and node-visitor extension, and Blade has a separate compiler with different syntax, directives, and component semantics. Blade will not parse JSX-like TwigX tags or prop expressions. To get similar component ergonomics in Laravel, use class-based or anonymous Blade components with slots and attribute bags. Those are first-party, documented, and supported by Laravel's tooling.
How does lmc/twigx-bundle compare with Laravel Blade components?
Blade components are Laravel's first-party answer to reusable, prop-driven view components, with class components, anonymous components, slots, and attribute bags. They are documented, IDE-supported, and require no extra dependency or alternate template engine. lmc/twigx-bundle targets Symfony's Twig stack and would introduce a second view layer, cache, and linting story in a Laravel app. For a Laravel-first codebase, Blade components are the lower-risk, like-for-like choice.
Can I register TwigX with rcrowe/twigbridge instead of using the Symfony bundle?
That is the more plausible experimental path, but it is not the package's supported integration. You would bypass lmc/twigx-bundle, pull alma/twigx, and register its extension and node visitors on a standalone Twig environment such as one provided through TwigBridge. The pivotal unknown is whether component resolution requires the Symfony service container; if it does, the standalone approach will not work without additional glue. This route still leaves you maintaining two templating engines in a Blade application.
Is lmc/twigx-bundle safe to use in production Laravel applications?
It is not recommended for production Laravel use because it is a Symfony bundle with no Laravel integration and very low adoption. The project shows tiny install numbers and no dependents, which suggests limited maintenance and a high bus-factor risk. Parser extensions also bind tightly to Twig internals and can break on minor upgrades, and parse errors may surface against generated PHP rather than your source template. If you must proceed, vendor a pinned fork, isolate rendering behind one service, and treat it as internal code.
What are the best alternatives to lmc/twigx-bundle for component-based views in Laravel?
Use Laravel's native Blade components, either class-based or anonymous, with slots and attribute bags. If the real goal is JSX-style authoring rather than Twig specifically, Inertia with React or Vue gives you that model without a custom template parser. On the Symfony side, Symfony UX TwigComponent is the first-party equivalent with a larger community. TwigX is only defensible where Twig is already the system of record, and even then TwigComponent should be benchmarked first.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo