承接 larapkg/laravel-social-user 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

larapkg/laravel-social-user

Composer 安装命令:

composer create-project larapkg/laravel-social-user

包简介

Social controller setup for using with Laravel Socialite

README 文档

README

Laravel Social User is a package that allows you to easily add social login to your Laravel API.

Combined with Laravel Socialite, Laravel Socialite Providers and Laravel Passport, you can easily add social login to your API for many social login providers.

Installation

You can install the package via composer:

composer require larapkg/laravel-social-user

To publish the configuration file which enables the setting of your applications user model, run:

php artisan vendor:publish --provider="Larapkg\LaravelSocialUser\Providers\LaravelSocialProviderServiceProvider" --tag="config"

If you want to alter the migrations, you can publish them with:

php artisan vendor:publish --provider="Larapkg\LaravelSocialUser\Providers\LaravelSocialProviderServiceProvider" --tag="migrations"

Usage

Run the migration to create the user_social_providers table.

Then attach the HasSocialUsers trait to your user model.

Publish the config and set up your required details, ensuring you set the user model.

Remove any fields you no longer need from the user table migration or create and run a migration to remove them, or make fields nullable.

Add a social login button to your frontend application and use the social provider's SDK to get the user's access token. Then send a POST request to your API with the access token and the provider name.

/social-login/[provider-name] passing the access_token in the request body.

Considerations

So every application needs a user strategy, and this package does not provide one.

Well it does, but it's not necessarily a good one or suitable for your use case.

So do you ONLY want social login, so your not responsible for user accounts?, or do you want to manage user accounts yourself? From a GDPR point of view etc., unless you know what you are doing, you should probably use the social login only strategy, and avoid storing any user data yourself that is not necessary. And provide a way for users to delete their accounts and maybe consider storing last_login details and deleting accounts after a period of inactivity (good practice to email users before).

As such, this package stores only the social provider's user id, name, email address and avatar, and when a user is deleted, if you have attached the HasSocialUsers trait to your user model, it will also delete the social user records for that user.

When using this package, when passing the social providers access_token to your API, it will always create a new user unless the social provider account has the same name and email as an existing user. i.e. on social login of a previously used social login account, the same user will be used, but social login from a different social login account will create a new user and those accounts will not be linked in any way.

When using the HasSocialUsers trait, the socialUsers() method will return a HasMany relationship, so you can access the social users for a user.

Other Considerations

Socialite and Passport should be installed, your social providers setup and your user model setup to use passport.

Those things are out of scope for this readme, but you can find more information on those things in the links below.

This package does not contain any tests.

larapkg/laravel-social-user 适用场景与选型建议

larapkg/laravel-social-user 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 91 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 03 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 larapkg/laravel-social-user 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 larapkg/laravel-social-user 我们能提供哪些服务?
定制开发 / 二次开发

基于 larapkg/laravel-social-user 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 91
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-23