anh/doctrine-resource-bundle
doctrine/orm or laravel-doctrine) or Symfony-adjacent stacks (e.g., Lumen, Symfony micro-services).anh/doctrine-extensions-resource) is Doctrine-agnostic. A Laravel TPM could evaluate:
laravel-doctrine/orm, integration is plausible with minor Symfony-specific adjustments (e.g., dependency injection).anh/doctrine-extensions-resource:0.4.* (abandonware risk; last update in 2016).EventDispatcher, DependencyInjection) may need polyfills or custom wrappers for Laravel.prePersist, preUpdate, etc., to manage resource invariants. Laravel’s event system could mirror this with doctrine/orm-event-listeners.ContainerInterface vs. Laravel’s Container. May require a bridge package (e.g., symfony/dependency-injection + illuminate/container adapter).config/yaml vs. Laravel’s config.php. Could use spatie/laravel-config-array for compatibility.Kernel vs. Laravel’s Application. Mocking may need adjustments.| Risk Area | Severity | Mitigation |
|---|---|---|
| Abandoned Package | High | Fork/replace anh/doctrine-extensions-resource or use alternatives like api-platform/core. |
| Symfony-Laravel Divide | Medium | Abstract Symfony-specific code behind interfaces; use Laravel’s DI container. |
| Doctrine Overhead | Low | Benchmark performance vs. Eloquent for the use case. |
| Version Lock | High | 0.4.* is ancient; may conflict with modern Doctrine/Laravel versions. |
| Documentation Gap | Medium | Assume undocumented behavior; write integration tests early. |
Why Doctrine?
Symfony vs. Laravel Tradeoffs
ParameterBag, HttpFoundation) that justify the integration?Maintenance Burden
anh/doctrine-extensions-resource is abandoned?api-platform, symfony/serializer) that achieve similar goals?Performance Impact
spatie/laravel-activitylog, custom observers)?Team Familiarity
laravel-doctrine/orm).| Component | Laravel Compatibility | Notes |
|---|---|---|
| Doctrine ORM | ✅ (via laravel-doctrine) |
Requires doctrine/orm: ^2.10 |
| Symfony EventDispatcher | ⚠️ (Polyfill needed) | Use symfony/event-dispatcher + Laravel events. |
| Dependency Injection | ⚠️ (Adapter needed) | Bridge symfony/dependency-injection to Laravel. |
| Config System | ⚠️ (Adapter needed) | Use spatie/laravel-config-array. |
| PHP 5.4+ | ❌ (Drop support) | Laravel 9+ requires PHP 8.0+. |
Assessment Phase:
Proof of Concept (PoC):
anh/doctrine-resource-bundle and replace Symfony-specific code with Laravel equivalents.ResourceListener with a Laravel ModelObserver.User) to validate resource behavior.Incremental Adoption:
findById, save) with resource abstractions.Fallback Plan:
laravel-resource-pattern).doctrine/orm-event-listeners to register listeners in Laravel’s boot().// app/Providers/AppServiceProvider.php
public function boot()
{
$em = DoctrineHelper::getEntityManager();
$em->getEventManager()->addEventListener(
['prePersist', 'preUpdate'],
new ResourceLifecycleListener()
);
}
$this->app->bind('anh.resource.manager', function ($app) {
return new ResourceManager($app['doctrine.orm.entity_manager']);
});
config/doctrine-resource.php:
'resources' => [
'App\Entity\User' => [
'lifecycle_callbacks' => ['validateInvariants'],
],
],
Pre-Requisites:
Core Integration:
@Resource) on entities.onPrePersist).API Layer Integration:
ETag headers).Validation & Testing:
Order).How can I help you explore Laravel packages today?