- Can I use **aescarcha/oauth** directly in a Laravel project without Symfony?
- No, this package is a Symfony bundle and requires Symfony’s kernel, routing, and dependency injection. You’d need to rewrite components for Laravel or use a Symfony bridge, which adds complexity. For Laravel, consider **league/oauth2-server** or **Laravel Passport** instead.
- What Laravel alternatives provide similar OAuth2 server functionality?
- For Laravel, **Laravel Passport** (built on league/oauth2-server) is the most popular choice. **spatie/laravel-oauth-server** is another lightweight option. Both avoid Symfony dependencies and integrate natively with Eloquent and Laravel’s middleware.
- Does this bundle support Laravel’s Eloquent ORM, or is Doctrine required?
- This bundle assumes **Doctrine ORM**, which conflicts with Laravel’s Eloquent. You’d need to rewrite the user repository layer or use a Doctrine-to-Eloquent adapter, adding significant maintenance overhead.
- How do I handle routing in Laravel if this bundle uses Symfony’s routing system?
- Symfony’s routing (e.g., YAML-based) won’t work in Laravel. You’d need to manually map the OAuth endpoints (e.g., `/oauth/token`) using Laravel’s `Route::post()` or rewrite the bundle’s routing logic to use Laravel’s router.
- Are the **NelmioApiDocBundle** and **FOSRestBundle** dependencies mandatory for basic OAuth?
- No, these are optional for API documentation and REST formatting. For a minimal OAuth server in Laravel, skip them and use **laravel/api-docs** or **spatie/laravel-api-docs** instead of Nelmio. FOSRest can be replaced with Laravel’s built-in JSON responses.
- What Laravel versions does this bundle support, and are there PHP 8.x compatibility issues?
- This bundle targets Symfony 4/5, which may not fully support PHP 8.x features like named arguments or constructor property promotion. Test thoroughly, or expect deprecation warnings. Laravel’s native OAuth packages are more actively maintained for PHP 8.x.
- How do I integrate this bundle’s OAuth middleware into Laravel’s middleware pipeline?
- Symfony’s OAuth middleware (e.g., token validation) won’t work directly in Laravel. You’d need to rewrite it as a Laravel middleware class, manually validating tokens against the OAuth server’s logic or using **league/oauth2-server**’s built-in middleware.
- Does this bundle include client credentials, password, or refresh token flows?
- Yes, it supports standard OAuth2 flows (e.g., password, client credentials) via **FOSOAuthServerBundle**. However, implementing these in Laravel would require adapting the Symfony-based grant handlers to Laravel’s service container and request lifecycle.
- What’s the maintenance status of this package, and are there active updates?
- The package appears low-maintenance (few stars/issues on GitHub). If you rely on it, monitor for Symfony version drops or security patches. For critical projects, consider **Laravel Passport** or **spatie/laravel-oauth-server**, which have larger communities.
- Can I use this bundle alongside Laravel Passport or league/oauth2-server?
- No, these packages serve the same core purpose (OAuth2 server). Mixing them would cause conflicts in routing, middleware, and token storage. Choose one and adapt it to Laravel, or rewrite the bundle’s logic to use Laravel’s native components.