symfony/console, symfony/dependency-injection). However, Laravel’s native DI container and configuration system (.env, config/) differ significantly from Symfony’s ConfigBundle..env for runtime overrides).CruditBundle (another 2lenet package) may limit standalone Laravel adoption unless Crudit is also integrated.ConfigInterface and Repository patterns can be adapted via Laravel’s Service Providers or Packages.Bundle system, requiring manual wiring of:
ParameterBag/Config abstractions.Config facade + Eloquent models for a lighter alternative.configs table with key, value, type fields).ConfigInterface implementations, Bundle lifecycle).ConfigRepository) without its Symfony layer.CruditBundle), or can Laravel alternatives (e.g., spatie/laravel-config-array) suffice?.env/config/ system meet needs?spatie/laravel-config-array (for structured configs).laravel/envoy (for deploy-time configs).ConfigBundle with Laravel’s config() helper + Eloquent models for DB-backed configs.ConfigRepository interface (inspired by the bundle’s pattern).symfony/options-resolver or symfony/property-access for advanced config validation (if needed).configurations table:
Schema::create('configurations', function (Blueprint $table) {
$table->id();
$table->string('key')->unique();
$table->text('value')->nullable();
$table->string('type')->default('string'); // e.g., 'string', 'boolean', 'array'
$table->timestamps();
});
class Config extends Model implements ConfigInterface { ... }
Config Eloquent model with key/value fields.public function boot() {
$configs = Config::all()->keyBy('key');
config($configs->pluck('value', 'key')->toArray());
}
value to bool/array based on type).ConfigRepository interface for type-safe access:
interface ConfigRepository {
public function get(string $key, $default = null);
public function set(string $key, $value): void;
}
CruditBundle).doctrine/dbal).php artisan config:warmup).| Step | Task | Dependencies |
|---|---|---|
| 1 | Fork/Refactor Bundle | None |
| 2 | Create Eloquent Config Model |
Laravel, DB |
| 3 | Build ConfigRepository |
Eloquent |
| 4 | Integrate with config() Helper |
Laravel Core |
| 5 | Add Admin UI (if needed) | Nova/Filament |
config()->cache()).| Risk | Mitigation |
|---|---|
| DB Downtime | Fallback to .env or cached configs. |
| Schema Migrations | Use Laravel Migrations; rollback-safe. |
| Config Corruption | Validate value types on write. |
| Package Abandonment | Fork early; replace with Laravel-native solutions. |
ConfigRepository + admin UI.How can I help you explore Laravel packages today?