acts/social-api-bundle
Symfony bundle for consuming OAuth 1/2 REST APIs with a simple client and extensible method list. Includes ready-to-use helpers for Facebook and Twitter endpoints, making authenticated requests and handling API responses in your app.
HttpClient, OptionsResolver) for API interactions.Guzzle, Symfony HttpClient), reducing vendor lock-in.HttpClient (introduced in Laravel 8+) or first-party OAuth packages (e.g., laravel/socialite).symfony/http-client (or guzzlehttp/guzzle) and symfony/options-resolver.league/oauth1-client or league/oauth2-client (not explicitly stated).HttpClient or Socialite if both are used.league/oauth2-client v6+, Laravel 10 support).spatie/laravel-socialite or knuckleswtf/socialite-providers.laravel/socialite or spatie/laravel-socialite?
Guzzle + league/oauth2-client be more maintainable?HttpClient, OptionsResolver).Socialite).Guzzle) are preferred.Socialite, raw Guzzle calls).spatie/laravel-socialite).composer require camdram/social-api-bundle
config/social_api.php for providers.config/app.php.SocialApi service into controllers/services:
use Camdram\SocialApiBundle\SocialApi;
public function __construct(SocialApi $socialApi) {
$this->socialApi = $socialApi;
}
Camdram\SocialApiBundle\Provider\ProviderInterface.HttpClient binding).league/oauth1-client with league/oauth2-client if needed.database, redis) aligns with Laravel’s caching drivers.Socialite) with the bundle for one provider.spatie/laravel-socialite) with data migration scripts.config/social_api.php.symfony/http-client, league/oauth*, etc.Log::error).HttpClient (configurable for async, retries, middleware).redis, database).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| OAuth token expiration | Broken API access | Implement token refresh logic (e.g., league/oauth2-client). |
| API provider downtime | Feature degradation | Fallback to cached data or graceful degradation. |
| Dependency vulnerabilities | Security risks | Regular dependency audits (e.g., sensio-labs/security-checker). |
| Laravel version incompatibility | Integration breaks | Test with Laravel 10 + PHP 8.1+ early. |
| Custom provider bugs | Data corruption | Unit tests for provider implementations. |
How can I help you explore Laravel packages today?