audunru/social-accounts
Laravel package for connecting and managing social media accounts. Link providers like Facebook, Twitter, and Instagram to your user models, handle OAuth authentication, and store access tokens securely so you can publish or fetch data on behalf of your users.
social_accounts relation supports use cases beyond auth: connecting a brand's Instagram/Twitter account for publishing, analytics pulls, or agency/tenant setups where one workspace owns many provider accounts.SocialAccountAdded / SocialUserCreated events plus the Strategy interface (FindUser, FindOrCreateUser, AddSocialAccount) let you defer onboarding flows, profile sync, and permission prompts to later releases without re-architecting.SocialAccountResource gives you a typed JSON shape for "which providers is this user connected to," useful if a mobile app or SPA needs to render connection state.Consider it when:
laravel/socialite ^5.0 is the only external dependency).users. The polymorphic relation and config-driven model/table/column overrides cover this cleanly.social-accounts.login.{provider}, social-accounts.callback.{provider}), automatic redirect-URI wiring, optional gate hooks (login-with-provider, add-social-account), and the ability to disable the built-in routes and own the controller.model key and the resource via resource key is the sanctioned path.Look elsewhere when:
encrypted casts yourself; if your security review treats that as non-negotiable-and-pre-solved, this adds work.Adoption guardrails if you proceed: add the user_id + provider unique index yourself if one-account-per-provider-per-user is a product rule (the default migration only enforces provider + provider_id); add encrypted casts on token/refresh_token; keep the built-in routes off in production if you need extra state parameters; and vendor-pin the version, since upstream release cadence is unpredictable.
To executives: This is a small, MIT-licensed Laravel component that gives us "Sign in with Google/Facebook/GitHub" and a place to store users' connected social accounts. It converts roughly one to three sprints of undifferentiated OAuth plumbing into roughly one to three days of integration, at zero licence cost. It is not a strategic dependency — it sits on top of Laravel Socialite, which we'd depend on anyway, and the code is small enough that we could absorb it in-house if the maintainer walks away. Recommendation: adopt for the social-login slice of the roadmap, with two small hardening tasks (token encryption, token refresh job) scoped as our own work rather than assumed as included.
To engineering: It's conventional Laravel — a HasSocialAccounts trait, a config-driven SocialAccount model, per-provider routes, events, and a Strategy interface for custom login-vs-link behaviour. No internal dependencies, tests use Mockery against Socialite contracts. The parts we own: token encryption casts, refresh-token scheduling, the one-account-per-provider uniqueness rule, and any provider with non-standard scopes. Config-driven model and resource overrides mean we extend rather than fork, which keeps upstream merges cheap. Main risk is maintenance, not architecture — pin the version and keep our extensions in our own namespace.
To security/compliance: Tokens are persisted in the database and are not encrypted by default, and refresh is not automatic. Treat both as our deliverables before any provider with write scope (publishing, messaging) is enabled. Read-only scopes on login-only providers can ship earlier.
Ask: approve the integration for the next release, and approve a follow-on ticket for token encryption plus a refresh job so we don't ship a connected-accounts feature with stale tokens.
How can I help you explore Laravel packages today?