- Is idci/merge-token-bundle compatible with Laravel?
- No. It is a Symfony bundle with no Laravel ServiceProvider, facade, or extra.laravel auto-discovery block, and Laravel has no Symfony kernel to register it against. You could force it in by pulling symfony/framework-bundle into your app, but that adds a large dependency tree and upgrade conflicts for a small string-substitution utility. Treat it as prior art rather than a drop-in Laravel dependency.
- How do I install idci/merge-token-bundle in a Laravel app?
- There is no supported Laravel installation path. Composer may resolve the package, but you would then need to bootstrap Symfony bundle services around Laravel's container manually. Run composer require --dry-run against your composer.lock first; if it wants PHP 5.6–7.x or Symfony 2/3 components, stop and reimplement the pattern instead.
- Which PHP and Symfony versions does MergeTokenBundle support?
- The package is a Symfony bundle of an older shape, so expect constraints pinned to legacy Symfony branches and older PHP versions. Modern Laravel requires PHP 8.1+ and Symfony 6/7 components, so a Composer conflict is more likely than not. Check composer.json and the last tagged release before planning any integration work.
- What token syntax does MergeTokenBundle use?
- It provides configurable token syntax and delimiters rather than one hard-coded placeholder style. That flexibility is useful for scoping requirements, but confirm the default delimiters and escaping rules in the bundle config before assuming compatibility with your templates. If you port the idea, define your own syntax contract and document it.
- How are unknown merge tokens handled by MergeTokenBundle?
- Unknown-token behaviour is the key failure-mode decision and should be verified in the bundle's resolver code, not assumed. Options typically include throwing an exception, leaving the literal token in place, or substituting an empty string. Whichever you choose, write it down and cover it with tests before touching PII-adjacent content.
- Does MergeTokenBundle support recursive token resolution and escaping?
- Yes, the bundle advertises recursive resolution with escaping controls. That is useful for nested personalization but also an injection and expansion risk if templates or token values are user-supplied. Add recursion depth limits, define HTML versus plaintext escaping, and cap expansion size in any implementation you adopt.
- Can I use MergeTokenBundle for personalized emails and contracts in Laravel?
- The capability fits those use cases well, but the package does not fit a Laravel stack. Personalized transactional email, statements, and contract rendering are exactly where merge tokens help, so capture the requirements and build a small Laravel-native resolver instead. Blade components or a dedicated token service will be easier to test and safer to maintain.
- Is idci/merge-token-bundle maintained and safe for production?
- Planning assumption should be that you become the maintainer the day you install it. The repository shows zero stars, zero dependents, and no visible release or CI signal, and there is no evidence of a threat model for a PII-adjacent code path. Confirm the LICENSE file and last commit date before copying any code.
- What are the best alternatives to MergeTokenBundle for Laravel?
- For Laravel, the practical alternatives are Blade rendering, a small in-house token parser with pluggable resolvers, or a maintained string-template library. Twig integration in the bundle does not carry over because Twig is not Laravel's native view layer. Reimplementing the resolver-registration pattern usually takes less effort than bridging the bundle.
- How should I test merge token resolution in Laravel?
- Write PHPUnit or Pest tests around your own parser rather than the bundle's services. Cover known tokens, unknown-token behaviour, escaping modes, recursion limits, nested tokens, and PII leakage in rendered output. If you fork any bundle code, add those tests before the first production release so regressions surface immediately.