canaltp/sam-ecore-user-manager-bundle
Symfony/Laravel Compatibility:
Auth system (e.g., Illuminate\Auth) is not directly compatible with Symfony’s SecurityBundle or UserManagerInterface. A custom facade/adapter would need to bridge the gap.Core Functionality:
UserManager pattern.spatie/laravel-permission (for RBAC)laravel/breeze/laravel/jetstream (for auth scaffolding)zizaco/entrust (legacy RBAC)
may already suffice, reducing the need for this bundle.Event-Driven Architecture:
UserEvents). Laravel has its own event system (Illuminate\Events), but mapping Symfony events to Laravel’s would require custom event listeners or a translation layer.High-Level Steps:
autoconfigure and services.yaml. Laravel uses ServiceProvider and bind()/singleton().UserInterface must be mapped to Laravel’s MustVerifyEmail/Authenticatable.User model that extends Symfony’s User but implements Laravel’s Authenticatable.config/packages/sam_ecore_user_manager.yaml → Laravel’s config/sam-ecore.php (manual or via package discovery).SecurityBundle guards (e.g., authenticator) must be replaced with Laravel’s Auth::attempt() or SessionGuard.Technical Risks:
Why Symfony Over Laravel?
SecurityBundle) that cannot be replaced in Laravel?Feature Parity Needs
Alternatives Assessment
spatie/laravel-permission + laravel/sanctum) been ruled out?Long-Term Viability
Laravel’s Native Alternatives:
laravel/breeze/jetstream (for UI) + laravel/sanctum (API).spatie/laravel-permission (roles/permissions).User model + HasApiTokens (for API users).Event::dispatch() instead of Symfony’s EventDispatcher.Symfony-Specific Dependencies:
SecurityBundle → Replace with Laravel’s Auth + Middleware.Doctrine ORM → Laravel uses Eloquent (migrations/adapters needed).Twig → Laravel uses Blade (template layer must be rewritten).| Symfony Component | Laravel Equivalent | Integration Strategy |
|---|---|---|
UserManagerInterface |
Custom UserService |
Create a facade wrapping Eloquent methods. |
SecurityBundle |
Illuminate\Auth |
Replace guards/authenticators with Laravel’s. |
EventDispatcher |
Illuminate\Events |
Map Symfony events to Laravel listeners. |
services.yaml |
config/sam-ecore.php + ServiceProvider |
Use Laravel’s config publishing. |
| Doctrine Entities | Eloquent Models | Generate Eloquent models from Symfony entities. |
| Twig Templates | Blade Views | Rewrite templates or use a bridge like twig-laravel. |
symfony/dependency-injection) may conflict with Laravel’s illuminate/container.composer require with --ignore-platform-reqs cautiously or isolate dependencies in a custom namespace.user table) may differ from Laravel’s default users table.doctrine/dbal).Phase 1: Proof of Concept (PoC)
Phase 2: Adapter Layer
// app/Providers/SamEcoreServiceProvider.php
public function register()
{
$this->app->singleton(UserManager::class, function () {
return new LaravelUserManagerAdapter(
new SymfonyUserManager() // Isolated instance
);
});
}
Phase 3: Full Integration
Auth system with the adapter where needed.// Replace Auth::user() with custom logic
Auth::shouldUse(SamEcoreGuard::class);
Phase 4: Testing & Optimization
composer.json (e.g., symfony/*:^6.0).UserManager may make future migrations difficult.SecurityBundle), Laravel may experience:
| Failure Scenario | Impact
How can I help you explore Laravel packages today?