laravel-uis/socialite-ui
Composer 安装命令:
composer require laravel-uis/socialite-ui
包简介
A Laravel Socialite UI for the new Laravel Starter Kits
README 文档
README
Laravel Socialite UI is a third-party Laravel package that connects the dots between Laravel Socialite and the new Laravel Starter Kits. It provides a simple way to add social authentication to your Laravel application.
Laravel Socialite UI supports the new React, Vue, Livewire (Volt) and Livewire (class-components) starter kits.
Note
Laravel Socialite UI is a third-party package and is not officially supported by Laravel.
Getting Started
We've worked incredibly hard to make it as easy as possible to add support for Laravel Socialite into your starter kit application.
To start using Laravel Socialite UI, create a new composer project using any of the starter kit templates and compile your frontend assets:
React
laravel new my-app --using=laravel-uis/socialite-ui-react-starter-kit
Vue
laravel new my-app --using=laravel-uis/socialite-ui-vue-starter-kit
Livewire (Volt)
laravel new my-app --using=laravel-uis/socialite-ui-livewire-starter-kit
Livewire (classes)
laravel new my-app --using=laravel-uis/socialite-ui-livewire-starter-kit:dev-components
Screenshots
Features
Laravel Socialite UI comes pre-configured with a bunch of useful features, ready for your next great idea:
1. "Remember Me" functionality
Laravel Socialite UI includes a "Remember Me" feature that allows users to stay logged in, even after they close their browser.
This setting is enabled by default, but can be disabled in the config/socialite-ui.php configuration file, simply remove this line:
Features::rememberSession(),
2. Global Login
Laravel Socialite UI includes a global login feature that allows users to log into your application from any page.
This setting is enabled by default, but can be disabled by removing the Features::globalLogin() line from your config file.
3. Generate Missing Emails
Some social providers do not return an email address for the user by default and require additional configuration in order to do so. Laravel Socialite UI includes a feature that generates a unique email address for these users.
This setting can be disabled by removing the Features::generateMissingEmails() line from your config file.
4. Refresh OAuth Tokens
Laravel Socialite UI includes a feature that automatically refreshes OAuth tokens when they expire when a user
logs into your application. Disable this setting by removing the Features::refreshOAuthTokens() line from your config file.
5. Create on login
If you have opted out of the Global Login feature of Socialite UI, you can still allow new users to be created from the login screen by uncommenting the Features::createAccountOnFirstLogin(), line in your config file.
Customization
Laravel Socialite UI is highly customizable and can be tailored to suit your application's needs.
1. User model
By default, Laravel Socialite UI uses the App\Models\User model for authentication and account creation. However, you may wish to use a different model.
To do so, you may call the SocialiteUI::useUserModel method from the boot method of you application's AppServiceProvider, passing in the fully qualified class name of your desired model.
use SocialiteUI\SocialiteUI; SocialiteUI::useUserModel(Path\To\Your\User::class);
2. Social Account model
Similarly, you may define a different model to be used for storing the details of linked social accounts
by calling the SocialiteUI::useSocialAccountModel method from the boot method of you application's AppServiceProvider.
use SocialiteUI\SocialiteUI; SocialiteUI::useSocialAccountModel(Path\To\Your\SocialAccount::class);
3. Customizing the actions
To keep your codebase clean, Socialite UI uses internal classes to perform specific actions when authenticating a user with a new, or known social account.
However, you are free to override these actions at any point.
Typically, you would call any of these methods within the boot method of a service provider.
use SocialiteUI\SocialiteUI; // Customize how Socialite UI generates the redirect URL for a provider SocialiteUi::generatesProvidersRedirectsUsing(...); // Customize how Socialite UI resolves users from Socialite SocialiteUi::resolvesSocialiteUsersUsing(...); // Customize how Socialite UI creates users from Socialite SocialiteUi::createUsersFromProviderUsing(...); // Customize how Socialite UI creates social accounts from Socialite SocialiteUi::createSocialAccountsUsing(...); // Customize how Socialite UI updates social accounts from Socialite SocialiteUi::updateSocialAccountsUsing(...); // Customize how Socialite UI handles the `Laravel\Socialite\Two\InvalidStateException` when attempting to resolve a user from Socialite. SocialiteUi::handlesInvalidStateUsing(...); // Override the callback logic used by Socialite UI to authenticate users. SocialiteUi::authenticatesOAuthCallbackUsing(...); // Customize how Socialite UI handles errors when returning from a failed login attempt from a provider. SocialiteUi::handlesOAuthCallbackErrorsUsing(...); // Use a custom prompt your users are shown when they attempt to link a new provider from the "Linked Accounts" screen. SocialiteUi::promptOAuthLinkUsing(...);
Contributing
Thank you for considering contributing to Socialstream! You can read the contribution guide here.
Code of Conduct
In order to ensure that the Laravel development community is welcoming to all, please review and abide by the Code of Conduct.
laravel-uis/socialite-ui 适用场景与选型建议
laravel-uis/socialite-ui 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.34k 次下载、GitHub Stars 达 11, 最近一次更新时间为 2025 年 03 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「oauth」 「oauth2」 「laravel」 「starter kit」 「socialite」 「laravel socialite」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 laravel-uis/socialite-ui 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 laravel-uis/socialite-ui 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 laravel-uis/socialite-ui 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
WeChat OAuth SDK
Ory-Hydra OAuth 2.0 Client Provider for The PHP League OAuth2-Client
Library for ORCID web services
A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.
Email Toolkit Plugin for CakePHP
The missing social authentication for thephpleague/oauth2-server, adapted from schedula/league-oauth2-social
统计信息
- 总下载量: 7.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 18
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-04

