- What is dinhquochan/laravel-twig used for?
- It integrates the Twig templating engine into Laravel so you can render .twig views alongside Blade. It provides a Laravel view engine, service provider, and configuration for Twig syntax, filters, and extensions. It is a framework-coupled Composer package, not a standalone service.
- Does laravel-twig support Laravel 10?
- Yes. The 3.0.0 release realigns the supported framework matrix to Laravel 10.x and requires PHP 8.1 or later. It is a conventional major-version maintenance release rather than a feature release. Verify your exact Laravel and PHP patch levels before upgrading.
- Is dinhquochan/laravel-twig compatible with Laravel 9?
- Laravel 9 support is not established by the 3.0.0 notes; they assert 10.x support and do not mention 9.x retention. Treat Laravel 9 as unverified until the maintainer confirms the supported floor. If you need Laravel 9, test on a branch or stay on the latest 2.x release.
- Can I use Twig and Blade together in a Laravel app?
- Yes, the package is designed to let you render .twig views alongside Blade. The Twig view engine is registered through the service provider, so existing Blade views can remain in place. You can migrate views incrementally rather than rewriting all templates at once.
- How do I install dinhquochan/laravel-twig in Laravel?
- Install it as a Composer dependency with composer require dinhquochan/laravel-twig, using a version compatible with your Laravel major. For Laravel 10, 3.0.0 is the relevant release; for Laravel 6, 7, or 8, 3.0.0 is a hard incompatibility, so pin 2.x. Follow the repository README for any service provider or config publishing steps.
- How do I configure Twig filters and extensions in Laravel with this package?
- The package includes configuration for Twig syntax, filters, and extensions and registers a Twig view engine through its service provider. Exact config keys and extension registration are documented in the repository README. Keep custom extensions in your application code so package upgrades do not overwrite them.
- Is laravel-twig 3.0.0 a breaking change from 2.x?
- Yes, 3.0.0 is a major-version maintenance release that drops Laravel 6, 7, and 8 support and adds parameter and return type hints. It also removes unspecified unused code, and the changelog does not include a migration guide or BC-break list. If you extend package classes, override methods, or mock internals, review those extension points before bumping.
- What PHP version does laravel-twig 3.0.0 require?
- The 3.0.0 release targets Laravel 10.x, which implies PHP 8.1 or later. The package notes do not list a separate PHP floor beyond the framework requirement. Confirm the exact constraint in the package's composer.json before deployment.
- How should I test a Laravel app that uses Twig views?
- Run your full test suite against 3.0.0 on a branch after upgrading the host app to Laravel 10 first. Because 3.0.0 adds type hints, static analysis plus good test coverage is more useful than the terse changelog for catching TypeErrors. Include tests for any package internals you subclass, decorate, or mock.
- Is dinhquochan/laravel-twig maintained, and what alternatives should I consider?
- The package is a small Laravel ecosystem library; 3.0.0 shows maintenance activity, but the changelog does not disclose release cadence or maintainer count. Alternatives include staying with Blade only or evaluating other Laravel Twig integrations if you need different extension or support guarantees. This package's specific fit is rendering .twig views alongside Blade in Laravel 10 applications. Pin a tested version and track the 2.x support window if services cannot move to Laravel 10.