- How do I install audunru/social-accounts in Laravel?
- Install the package with Composer using composer require audunru/social-accounts. Then follow the package README for any required service provider registration, configuration publishing, or migrations. Run your Laravel migrations after publishing any package migrations.
- Which Laravel versions does audunru/social-accounts support?
- The supported Laravel versions depend on the package's Composer constraints and its release history. Check the composer.json file and the GitHub releases for the exact Laravel and PHP requirements. For older Laravel applications, verify compatibility before installing in production.
- How do I link a social account to a user model?
- The package provides a simple API for associating social media accounts with your application's models. Use the documented linking methods or relationships to create the association after a user authenticates through the social provider. Review the README examples for the exact model and provider setup.
- How can I retrieve a user's connected social accounts?
- Connected accounts are associated with your models through the package's API, so you can retrieve them from the model relationship or query methods documented by the package. This lets you display linked providers or check whether a user already has a given social account connected. Use the package's retrieval methods rather than querying provider data directly.
- Does audunru/social-accounts handle OAuth tokens for social providers?
- Yes, the package is designed to handle OAuth tokens associated with connected social accounts. It helps you store and manage provider tokens so you can work with linked services such as Facebook, Twitter, Instagram, and Google. Check provider-specific documentation for token lifetime and refresh behavior in your application.
- Which social providers are supported by audunru/social-accounts?
- The package is built for social account integration with providers such as Google, Facebook, Twitter, and Instagram. It focuses on associating provider accounts with your Laravel models rather than replacing a full OAuth client implementation. For additional providers, review the package documentation and your OAuth integration options.
- Can I use audunru/social-accounts with models other than the default User model?
- The package is described as associating social media accounts with your application's models, not only the default User model. This makes it suitable for applications that represent accounts through a custom model or multiple model types. Confirm the required traits or relationships in the README for your specific model setup.
- How should I test social account linking in a Laravel application?
- Use Laravel's testing tools with a test database and mock or fake the OAuth provider responses so tests do not call real social APIs. Then assert that the expected social account association and token data are created or updated. Keep provider callback URLs and configuration values set consistently in your test environment.
- What should I consider before using audunru/social-accounts in production?
- Treat OAuth tokens as sensitive data and ensure they are stored securely, ideally encrypted at rest, with strict access controls. Configure correct callback URLs for each provider, use HTTPS, and monitor token expiration or revoked access. Also review the package's maintenance status and Laravel compatibility before relying on it in production.
- What are alternatives to audunru/social-accounts for Laravel social login?
- Laravel Socialite is the common foundation for social authentication in Laravel and can be combined with your own social account table. Other community packages provide similar social login or account-linking features. Choose based on whether you mainly need login, token management, or model-level social account associations.