dolmitos/symfony-entity-creator-bundle
Model::create(), Eloquent events, or packages like spatie/laravel-model-states) or custom trait-based approaches for similar functionality.EntityCreator logic into Laravel’s Eloquent/Query Builder.Configuration and Definition systems (e.g., YAML/XML parsers for entity schemas).PropertyAccess → Laravel’s dynamic property access (e.g., Model::set()).EventDispatcher) → Laravel’s Model::dispatch() or package-based event systems.spatie/laravel-model-states for stateful entities or laravel-nova for scaffolding) avoids framework-level integration.Why Symfony-Specific?
Feature Parity Needs
Long-Term Viability
laravel-entity-creator) be more sustainable?Performance/Scaling
EntityCreator using:
eval() or Model::fromArray()).EventDispatcher with Laravel’s events facade or a package like laravel-event.spatie/array-to-object or custom logic.Model::unguard() for dynamic fields, spatie/laravel-activitylog for auditing).Assess Feature Gaps
Prototype Core Logic
// Example: Dynamic Eloquent model creation
$entityData = ['name' => 'Test', 'metadata' => ['key' => 'value']];
$model = new class extends Model {
protected $fillable = ['name', 'metadata'];
};
$model->fill($entityData)->save();
Decouple from Symfony
Configuration → Laravel’s config() or environment variables.EventDispatcher → Laravel’s event() or Model::dispatch().Package the Solution
laravel-entity-dynamic) to avoid future dependency on Symfony.string, array) to Eloquent casts.boot() methods).KernelEvents with Laravel’s ModelEvents or custom events.PRE_PERSIST → Laravel’s creating model event.Configuration class with Laravel’s config() or a package like spatie/laravel-config-array.EntityCreator solves a unique problem not addressed by Laravel tools.PropertyAccess, EventDispatcher) that may conflict with Laravel’s ecosystem.eval()) may impact:
Schema::table()).| Risk | Impact | Mitigation |
|---|---|---|
| Integration Bugs | Symfony logic fails in Laravel (e.g., event listeners not triggered). | Write comprehensive tests; use feature flags to isolate the new code. |
| Performance Degradation | Dynamic entity creation slows down requests. | Benchmark; cache generated models; avoid runtime schema changes in hot paths. |
How can I help you explore Laravel packages today?