- Can I use this bundle directly in Laravel without Symfony?
- No, this bundle is Symfony-specific and relies on FOSUserBundle, HWI OAuth, and FOSRestBundle. For Laravel, you’d need to either consume its REST API via HTTP client or rewrite functionality using Laravel-native packages like `laravel/socialite` for OAuth and `spatie/laravel-permission` for RBAC.
- What Laravel alternatives provide similar Facebook OAuth + user management?
- For Laravel, consider `laravel/socialite` (Facebook OAuth) paired with `spatie/laravel-socialite-bridge` for HWI-like functionality, or `spatie/laravel-permission` for RBAC. The `fruitcake/laravel-cors` package can help with API cross-origin requests if you build a custom REST layer.
- Does this bundle support Laravel’s Eloquent ORM, or is Doctrine required?
- This bundle requires Doctrine ORM and introduces custom `User` entities/repositories, which won’t work natively with Laravel’s Eloquent. You’d need a Doctrine Bridge (e.g., `doctrine/orm`) or accept limitations like missing FOSUserBundle events if using Eloquent.
- How do I configure Facebook OAuth in this bundle for Symfony?
- Edit `config.yml` under `hwi_oauth.resource_owners.facebook` with your `client_id`, `client_secret`, and `infos_url`. Define `firewall_name` (e.g., `secured_area`) and map Facebook fields (e.g., `facebookId`) in the `fosub.properties` section. Ensure `HWIOAuthBundle` is registered in `AppKernel.php`.
- What Laravel versions or PHP dependencies does this bundle require?
- This bundle targets Symfony, not Laravel, so it requires PHP 7.1+ and Symfony 3.4+/4.x. For Laravel, you’d need to abstract dependencies like FOSRestBundle/Fractal via a microservice or API layer, adding complexity. Check the bundle’s `composer.json` for exact Symfony versions.
- Is the REST API layer stable, and how do I test it in Laravel?
- The REST API depends on FOSRestBundle and Fractal, which are Symfony-specific. To test from Laravel, use the HTTP client (`GuzzleHttp`) to call endpoints like `/api/users`. Benchmark latency if using this as a microservice, as cross-process communication adds overhead.
- Are there any known issues with the bundle’s tests or documentation?
- The README acknowledges tests are incomplete and require a clean Symfony setup. The bundle lacks stars/maintenance, so expect manual fixes. For Laravel, rely on the Symfony docs for configuration but prepare for gaps in OAuth or API integration.
- Can I use this bundle alongside Laravel in a hybrid architecture?
- Yes, but it’s complex. Deploy the bundle as a separate Symfony microservice behind an API gateway (e.g., Kong or Laravel’s built-in routing). Use GraphQL (via `webonyx/graphql-php`) or REST to communicate between Laravel and Symfony. Docker/Kubernetes can help manage the microservice.
- What’s the performance impact of consuming this bundle’s REST API from Laravel?
- Latency depends on network distance and API gateway overhead. For user operations (e.g., login, profile updates), aim for <100ms RTT. Test with tools like `k6` or `Postman` before production. If performance is critical, consider rewriting the API in Laravel-native packages.
- How do I handle user events (e.g., registration) in Laravel if using this bundle’s API?
- Since the bundle uses Symfony’s event system (e.g., `FOSUserEvents`), you’ll need to listen to its REST API responses in Laravel. Use Laravel’s `HttpClient` to poll `/api/users` for changes or implement webhooks if the bundle supports them. For real-time updates, consider Laravel Echo + Pusher.