oveleon/contao-config-driver-bundle
Adds a Config data container driver to Contao CMS. Load DCA palettes/fields from template or bundle config files and render them in the backend. Store values in localconfig or serialize them into an existing DB column, with support for overrides and merging.
Architecture Fit
The contao-config-driver-bundle v1.5.0 introduces container parameter support within DCA field options, a feature that deepens Laravel’s integration with Contao’s Data Container Adapter (DCA) by leveraging Laravel’s dependency injection (DI) container for dynamic field configurations. This aligns seamlessly with Laravel’s ecosystem, particularly for projects using:
app()->bind() or config()).The package’s modular design ensures backward compatibility while enabling runtime flexibility for DCA fields, reducing hardcoded values in favor of container-resolvable dependencies. This is particularly valuable for:
Integration Feasibility
app() helper behavior in older Laravel versions.Technical Risk
BootstrapServiceProvider), container bindings may fail. Mitigate by:
contao-config-driver-bundle is loaded after core Laravel bindings (check config/app.php providers).booted() callbacks or AppServiceProvider to defer container-dependent DCA configurations.app('config.dca.field_options') depending on another container-bound service). Test with:
shouldDefer() or lazy loading for problematic bindings.tl_content or tl_module table updates where DCA fields are involved.tl_content cache). Evaluate:
tl_cache table.config_cache with Contao cache events).Key Questions
ContainerAwareFieldType trait or similar).onGetDcaFieldOptions or similar events? Containerized fields might interact with these listeners in unexpected ways.Stack Fit
tl_content fields defined in Laravel’s config/services.php.app('contato.field_options')).Migration Path
oveleon/contao-config-driver-bundle to ^1.5.0 in composer.json.composer update oveleon/contao-config-driver-bundle --with-dependencies.options arrays in DCA fields that could be containerized. Example:
// Before (static)
'options' => ['red', 'green', 'blue'],
// After (containerized)
'options' => app('config.dca.colors'),
AppServiceProvider:
public function register()
{
$this->app->bind('config.dca.colors', function () {
return config('contato.field_options.colors');
});
}
'options' => app()->bound('config.dca.colors') ? app('config.dca.colors') : ['red', 'green', 'blue'],
config_cache and Contao’s cache after updates:
php artisan config:clear
php contao:clear-cache
tl_cache, ensure containerized fields don’t invalidate it unexpectedly.Compatibility
app() helper behavior in DCA contexts.Sequencing
CONTAO_USE_CONTAINER_DCA) to enable gradual rollout.if (config('contato.use_container_dca', false)) {
'options' => app('config.dca.colors'),
} else {
'options' => ['red', 'green', 'blue'],
}
How can I help you explore Laravel packages today?