certunlp/database-config-bundle
config.yml/parameters.yml files are inflexible.Config repository or ServiceProvider hooks).AppKernel logic with a Laravel ServiceProvider that hooks into boot() to load DB-backed configs into Laravel’s Config repository.configurations) with columns for bundle, key, value, and environment. Laravel’s migrations can replicate this.file, redis) to mirror Symfony’s caching behavior.ContainerBuilder events may need Laravel equivalents (e.g., ConfigRepository listeners).config and env; explicit separation may require custom logic.Resources/config/. Laravel’s modularity (packages) would need analogous mapping.ContainerBuilder is not natively available in Laravel; requires significant customization.laravel-database-config)..env + config caching? What problem does this solve that env/cache can’t?ContainerBuilder with Laravel’s Config repository and ServiceProvider lifecycle.configurations table.Cache::rememberForever()) to store configs after first DB load.configurations table with columns:
Schema::create('configurations', function (Blueprint $table) {
$table->id();
$table->string('bundle')->nullable();
$table->string('key');
$table->text('value');
$table->string('environment')->default('*');
$table->timestamps();
});
config:load command to refresh configs from the DB (with cache invalidation).ServiceProvider and Config repository.DatabaseConfigService to load configs from the DB into Laravel’s cache.config/ files with DB-backed configs for non-critical settings (e.g., logging, third-party API keys).ConfigListener to invalidate cache on DB updates (via Eloquent events or a queue job).doctrine/dbal via Composer).ContainerBuilder) by abstracting logic.app()->environment() to filter configs by environment (e.g., development, production).configurations table via migration.APP_DEBUG, MAIL_MAILER).DatabaseConfigServiceProvider that boots during ServiceProvider::boot().Config::get() to check the DB cache before falling back to config/ files.ConfigCache class to store DB configs with tags (e.g., config:bundle_name).php artisan config:clear after DB updates").config:debug command to dump cached vs. DB configs.configurations table.environment column values match Laravel’s environments.(bundle, key, environment) for fast lookups.pgsql:pool) if high QPS.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| DB connection loss | Configs fall back to config/ files |
Graceful degradation with fallback configs. |
| Cache corruption | Stale configs served | Implement cache versioning or TTLs. |
| Schema migration failure | Configs unreadable | Backup config/ files as a last resort. |
| High cache invalidation rate | Performance degradation | Rate-limit invalidations or use a queue. |
config:load command and cache invalidation workflows.configurations table.mailer settings) to the DB.config() with feature flags to toggle DB-backed configs.How can I help you explore Laravel packages today?