Weave Code
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

Twig Pack Laravel Package

symfony/twig-pack

Official Symfony pack that bundles Twig templating for Symfony apps: Twig, the Twig bridge and needed integrations. Quick install via Composer to add rendering, templates, extensions and common defaults for modern Symfony projects.

View on GitHub
Deep Wiki
Context7

A Symfony pack for Twig

Frequently asked questions about Twig Pack
Can I use symfony/twig-pack in a pure Laravel project without Symfony dependencies?
No, this package is designed for Symfony projects and may introduce conflicts with Laravel’s core dependencies like Symfony’s console or HTTP components. For pure Laravel, standalone `twig/twig` or Blade is safer.
What Symfony-specific Twig features does this pack provide that Laravel’s Twig doesn’t?
The pack bundles Symfony’s Twig extensions like `{% embed %}`, `{% macro %}`, and auto-reload for includes. Laravel’s native Twig lacks these features unless manually configured with Symfony’s bridge.
Will symfony/twig-pack work with Laravel 10.x and PHP 8.2+?
Unlikely. The last release was in 2020, and it may not support Laravel 10.x’s updated architecture or PHP 8.2’s strict typing. Test thoroughly or use standalone `twig/twig` instead.
How do I avoid dependency conflicts between symfony/twig-pack and Laravel’s Symfony components?
Isolate Symfony services in a dedicated namespace or use a hybrid approach: install the pack but manually configure Twig to work with Laravel’s service container. Avoid relying on auto-configuration.
Does this pack support Laravel’s View facade or Blade directives?
No. The pack is Symfony-centric and won’t integrate with Laravel’s `View` facade or Blade directives. Use standalone Twig or Blade for Laravel-specific features.
Is there a way to test symfony/twig-pack in a Laravel project before full integration?
Yes. Install it in a sandbox (`composer require symfony/twig-pack`), then test Twig template rendering via Laravel’s service container (e.g., `app('twig')`). Check for errors or conflicts with Laravel’s core.
What are the security risks of using an unmaintained Twig pack in Laravel?
Outdated Twig versions in the pack may expose vulnerabilities like XSS or RCE. Since it’s unmaintained, rely on Laravel’s built-in Twig (if used) or standalone `twig/twig` for security patches.
Can I use this pack for email templates in Laravel if I need Symfony’s Twig extensions?
Yes, but only if your project already uses Symfony components. For email templates, consider a hybrid setup: install the pack for Symfony extensions but configure Twig to work alongside Laravel’s View system.
What’s the best alternative to symfony/twig-pack for Laravel projects needing Twig?
Use standalone `twig/twig` with Laravel’s service container or manually integrate Symfony’s Twig bridge (`symfony/twig-bridge`) if you need specific features. Avoid the pack unless migrating from Symfony.
How do I configure symfony/twig-pack to work with Laravel’s middleware stack?
The pack doesn’t natively support Laravel’s middleware. You’ll need to manually bind Twig services to Laravel’s container and ensure Symfony’s event dispatcher doesn’t interfere with Laravel’s PSR-15 middleware.
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.
yandex/translate-api
voku/simple_html_dom
league/flysystem-vfs
bkwld/upchuck
filament/spatie-laravel-tags-plugin
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php