LiipThemeBundle (originally for Symfony2/3) and explicitly targets Twig 3.x, aligning with Symfony 4/5/6. This makes it a viable candidate for modular theming in Symfony-based Laravel-like applications (e.g., Octane, Symfony-integrated PHP projects).Resources/themes/<theme>), which is useful for microservice-like bundles or feature-specific UI customization without global theme overrides.symfony/http-kernel)./theme routes, which may conflict with existing Laravel routes unless namespaced carefully.SymfonyBridge).ThemeListener vs. Laravel’s ViewComposer).Resources/themes/) may need Laravel path aliases (e.g., resources/themes/).resources/views/vendor/package/).spatie/laravel-theme or orchid/theme.twig:theme).theme() helper in Laravel)?| Component | Compatibility | Workarounds |
|---|---|---|
| Symfony Kernel | Required (Symfony 4/5/6). Conflicts with Laravel’s Application unless bridged. |
Use symfony/http-kernel as a micro-framework or wrap in a Laravel service. |
| Twig 3.x | Native support. Laravel uses Blade by default. | Install Twig via Composer; configure as a fallback or parallel engine. |
| Routing | Introduces /theme routes. Conflicts with Laravel’s router. |
Prefix routes (e.g., /admin/theme) or use route middleware to isolate. |
| Composer | Lightweight dependency. | Pin version (^1.0) to avoid auto-updates. |
| Service Container | Symfony’s DI vs. Laravel’s IoC. | Use SymfonyBridge or manual binding (e.g., ThemeServiceProvider). |
spatie/laravel-theme).composer require twig/twig symfony/twig-bridge
Configure Twig as a service provider alongside Blade.LiipThemeBundle.RouteServiceProvider).// app/Providers/ThemeServiceProvider.php
public function register()
{
$this->app->register(Liip\ThemeBundle\LiipThemeBundle::class);
// Override Twig loader to support Laravel paths.
}
config/services.php or environment:
# config/packages/liip_theme.yaml (Symfony-style)
liip_theme:
themes: [default, admin]
active_theme: default
Resources/themes/<theme>/Controller/Action.html.twig.ln -s resources/views vendor/bundle/Resources/themes/default
symfony/framework-bundle.Route::prefix('/theme')->group(...) to isolate.ThemeEvents) won’t trigger in Laravel. Use Laravel events as a proxy.{% asset %} vs. Laravel Mix/Vite. Configure asset pipelines separately.Resources/themes/ → default Twig views).@include('theme::partial') vs. {{ include('theme::partial') }}).config('theme.active')).config()).LiipThemeBundle docs (Symfony 2/3 context).LiipThemeBundle.theme() function adds a lookup step per template.Cache::remember()).config table.| Failure Scenario | Impact | **
How can I help you explore Laravel packages today?