connectholland/user-bundle
Symfony 4.4/5 user bundle providing registration and login forms, user creation command, email confirmation links, password recovery, optional OAuth (Google/GitHub/Facebook), and API accessibility. Optional JWT auth via Lexik bundle.
HttpFoundation in Laravel via symfony/http-foundation).services.yaml.lexik/jwt-authentication-bundle. This is a strong fit for Laravel TPMs accustomed to laravel/sanctum or typhonium/laravel-jwt-auth, but requires Symfony-specific API Platform configuration.User entity is designed to be cloned/extended, similar to Laravel’s HasFactory or Notifiable traits. Custom fields can be added via Doctrine inheritance or composite entities, though this may introduce migration complexity for large teams.symfony/http-foundation, symfony/security-bundle, and api-platform/core via Composer.routes/web.php) would need to delegate to Symfony’s routing.yaml or use a middleware bridge (e.g., spatie/laravel-symfony-support).Illuminate\Container wrappers for Symfony services).symfony/event-dispatcher) would need to be shimmed for Laravel’s events system./api/auth) while keeping Laravel’s web routes.User entity, Authenticator classes) into a shared PHP library (e.g., vendor/bin/connectholland-auth).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony Dependency Overhead | High | Evaluate composer.json conflicts early. Use symfony/flex recipes to resolve bundles. |
| Routing Conflicts | Medium | Prefix Symfony routes (e.g., /auth/) or use Laravel’s Route::namespace(). |
| JWT/API Platform Complexity | High | Test Lexik JWT and API Platform integration in a staging environment first. |
| OAuth Provider Gaps | Low | Bundle supports HWI OAuth, but custom providers may need Symfony-specific tweaks. |
| Database Schema Lock-in | Medium | Clone the User entity early to avoid migration pain if extending fields. |
| Lack of Laravel Docs | Critical | Treat as a Symfony-only package; document polyfill requirements upfront. |
Stack Alignment:
API Strategy:
spatie/laravel-permission) that could coexist with this bundle?Extensibility Needs:
User model require polymorphic relationships (e.g., User hasMany Post) or custom accessors? If so, how will these be merged with the bundle’s entity?Compliance & Security:
Team Skills:
flex recipes or make:bundle commands?Future-Proofing:
composer require and environment variables./api/auth endpoints.User entity, Authenticator) could be extracted into a standalone package (e.g., vendor/bin/connectholland-auth-laravel), but this requires refactoring to remove Symfony-specific code.| Phase | Action Items | Tools/Dependencies |
|---|---|---|
| Assessment | Audit composer.json for conflicts. Test Symfony bundles in a staging Laravel project (e.g., symfony/http-foundation, api-platform/core). |
composer validate, php artisan vendor:publish (for config) |
| Polyfill Layer | Create a Laravel service provider to bridge Symfony’s DI and events. Example: | spatie/laravel-symfony-support, symfony/console (for CLI commands) |
| ```php | ||
| // Example: Bridge Symfony’s EventDispatcher to Laravel | ||
| $this->app->singleton(SymfonyEventDispatcher::class, function () { | ||
| return new SymfonyEventDispatcher(new LaravelEventDispatcher($this->app['events'])); | ||
| }); | ||
| Core Integration | Install the bundle in a Symfony subdirectory (e.g., /symfony-auth) or as a Composer package. |
composer create-project, symfony/var-dumper (for debugging) |
| Routing Alignment | Map Laravel routes to Symfony’s routing.yaml or use reverse proxy (e.g., Nginx) to delegate /auth/* to Symfony. |
laravel/valet (for local dev), nginx (for prod) |
| API Gateway | If using API Platform, configure Lumen or Laravel’s RouteServiceProvider to proxy requests to Symfony’s API endpoints. |
guzzlehttp/guzzle (for HTTP clients), spatie/laravel-honeypot (for security) |
| Testing | Write Pest/PHPUnit tests for cross-stack auth flows (e.g., OAuth callbacks, JWT validation). | pestphp/pest, mockery/mockery |
| Deployment | Containerize Symfony and Laravel as separate services (e.g., Docker Compose) or merge into a single PHP-FPM pool with namespace isolation. | docker-compose.yml, php-fpm (for shared hosting) |
| Laravel Feature | Symfony Bundle Compatibility |
How can I help you explore Laravel packages today?