league/oauth2-server, this bundle may introduce redundancy or conflicts.symfony/bridge or a forked version to bridge Symfony components (e.g., HttpFoundation, HttpKernel). This adds complexity and maintenance overhead.routes/api.php) and middleware (app/Http/Kernel.php) would need to delegate OAuth2 logic to Symfony’s EventDispatcher or a custom facade, risking tight coupling.Doctrine or DoctrineBundle for user/token storage. Laravel’s Eloquent or custom storage would require adapters.Why Not Laravel-Native?
league/oauth2-server, spatie/laravel-oauth-server, or knuckleswtf/oauth2-server-laravel?Customization Needs
Long-Term Viability
HttpFoundation, EventDispatcher, and SecurityBundle. Laravel would need:
symfony/http-foundation (via Composer).EventDispatcher bridge (e.g., Laravel’s Illuminate\Events → Symfony’s EventDispatcher).Illuminate\Http (e.g., request/response objects).illuminate/database ↔ doctrine/orm).Proof of Concept (PoC)
symfony/bridge to prototype middleware/routing integration.Wrapper Layer
AuthServerEvents → Laravel’s Events).Router with Laravel’s Router (risky; may require forking).Fallback Plan
spatie/laravel-oauth-server) and port custom logic from this bundle.routing.yml would need conversion to Laravel’s routes/api.php with middleware (oauth2.auth).AuthServerMiddleware would need a Laravel equivalent (e.g., Kernel.php middleware group).config.yml → Laravel’s config/oauth.php with validation for missing keys (e.g., clients_table, access_tokens_table).Phase 1: Dependency Isolation
http-foundation, event-dispatcher) to composer.json without the bundle.Phase 2: Bundle Integration
/oauth/authorize, /oauth/token) in Laravel’s routing.Phase 3: Data Layer
Phase 4: Security & Testing
Symfony\Component\HttpKernel\Exception\NotFoundHttpException) may not align with Laravel’s debugging tools (e.g., dd(), debugbar).EventDispatcher may add latency compared to Laravel’s lighter event system.Session component might conflict with Laravel’s session service.Cache component could integrate with Laravel’s cache, but configuration would require careful tuning.Request object differs from Laravel’s (e.g., getClientIp() behavior).VerifyCsrfToken vs. Symfony’s CSRF protection).TrustProxies for OAuth2 token validation).Sanctum or Passport integrations.serialized vs. JSON fields for token storage).Bundle architecture and Laravel’s ServiceProvider patterns.GrantType, ResourceServer) would require additional training.How can I help you explore Laravel packages today?