ekyna/SettingBundle provides a structured way to manage application parameters (e.g., configurations, feature flags, or runtime settings) via a Symfony/Laravel-compatible bundle. This aligns well with Laravel’s need for centralized configuration management, especially for dynamic or environment-specific settings that aren’t ideal for config/ files or .env.SettingManager).config() cache or cache() driver for mutable settings.config(), env(), and packages like spatie/laravel-settings or beberlei/attributes. This bundle’s niche is its Symfony integration pattern (e.g., YAML/XML parameter files) and potential for hierarchical/namespace settings.required, type) can be mapped to Laravel’s Validator or spatie/laravel-validation-rules.Route::redirect() or middleware.DependencyInjection and Config components. Laravel’s container is compatible but may require shims (e.g., symfony/dependency-injection as a composer dependency).settings table with namespace, key, value columns).cache()->remember()).Illuminate/Config) may conflict with Symfony’s Config component.spatie/laravel-settings or beberlei/attributes?config() cache? Is it optimized for high-read scenarios?settings table achieve the same with less risk?SettingManager can be registered as a Laravel service provider:
// app/Providers/SettingServiceProvider.php
public function register() {
$this->app->singleton('setting.manager', function ($app) {
return new \Ekyna\SettingBundle\Manager\SettingManager(
$app['config'], // Laravel's config
$app['db'] // Laravel's DB
);
});
}
Setting facade for fluent access:
// app/Facades/Setting.php
public static function get($key) { return app('setting.manager')->get($key); }
Schema::create('settings', function (Blueprint $table) {
$table->string('namespace');
$table->string('key');
$table->text('value');
$table->timestamps();
});
$setting = Setting::where('namespace', 'app')->where('key', 'theme')->first();
app.debug = true in the DB and retrieve via Setting::get('app.debug').Config with Laravel’s config().SettingService to bridge the bundle’s logic with Laravel’s container.Validator for input sanitization.symfony/yaml, symfony/config may require polyfills or alternatives.Events instead.Symfony\Component\Yaml\Yaml with spatie/array-to-xml or custom parsers.Cache facade for the bundle’s caching layer.Setting facade → expand to validation → add caching.laravel-setting-manager).composer require symfony/dependency-injection only for the bundle, not globally.InvalidConfigurationException) will require deep dives.null for missing settings instead of crashing).settings table or clear caches.SELECT * FROM settings per request). Mitigate with:
cache()->remember() for frequent settings.namespace and key.database transactions or optimistic locking.DB::transaction(function () {
$setting = Setting::find($id);
$setting->value = $newValue;
$setting->save();
});
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Bundle throws undocumented |
How can I help you explore Laravel packages today?