cortezvini97/symfony-hybrid-views-bundle
Twig → PHP → Blade).EventDispatcher, HttpKernel, and Templating components are not natively available in Laravel.View and Renderer interfaces.ViewFactory or EngineResolver.View::addExtension().spatie/laravel-view-models offer similar flexibility.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony Dependency | Critical | Abstract Symfony components or avoid direct use. |
| Performance Overhead | Medium | Benchmark hybrid resolution vs. native Blade. |
| Maintenance Burden | High | Limit scope to non-critical paths (e.g., admin panels). |
| Compatibility Issues | High | Test with Laravel’s latest LTS (e.g., 10.x). |
| Security Risks | Medium | Audit dynamic view resolution for RCE risks. |
@stack) suffice?symfony/http-kernel, symfony/templating, etc.View system for multi-engine support.@extends/@section for modularity.View::addNamespace()).View events (lower effort).EventDispatcher → Laravel’s Events system.tightenco/ziggy or spatie/laravel-twig-view if needed.| Phase | Tasks |
|---|---|
| Discovery | Document use cases; benchmark alternatives. |
| Design | Decide: Fork/rewrite or custom build? Define Laravel adapters. |
| Development | Implement hybrid resolver; integrate with Laravel’s View system. |
| Testing | Validate edge cases (e.g., missing templates, caching). |
| Deployment | Canary release to non-critical routes. |
| Monitoring | Track errors, performance, and developer adoption. |
HttpKernel).replace to avoid pulling unused Symfony packages.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Symfony Component Breaks | Bundle fails entirely. | Isolate in a micro-service or drop. |
| Twig/Blade Conflict | Template syntax errors. | Strict validation in CI. |
| Caching Invalidation | Stale hybrid views. | Use View::flush() or event hooks. |
| Security Misconfig | RCE via dynamic includes. | Whitelist allowed view engines. |
| Laravel Upgrade Issues | Bundle incompatible with new Laravel. | Pin Symfony deps strictly. |
EventDispatcher → Laravel’s Events.- name: Test Hybrid Views
run: php artisan view:test --hybrid
How can I help you explore Laravel packages today?