定制 acacha/laravel-social 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

acacha/laravel-social

Composer 安装命令:

composer require acacha/laravel-social

包简介

Social Login/Register implementation using Laravel Socialite and AdminLTE Laravel package

README 文档

README

Latest Version on Packagist Total Downloads Monthly Downloads Daily Downloads Latest Stable Version Software License Build Status Quality Score StyleCI

A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package.

Installation

Using adminlte laravel (recommended option)

Install AdminLTE Laravel package:

composer global require "acacha/adminlte-laravel-installer"
laravel new awesome
cd awesome
adminlte-laravel install
adminlte-laravel social

Then optionally you can boostrap you project in your favourite browser using:

llum boot

Using composer

Use Composer, in you Laravel project:

$ composer require acacha/laravel-social

Add service provider to providers array in your config/app.php file:

Acacha\LaravelSocial\Providers\LaravelSocialServiceProvider::class

And run command:

php artisan make:social

To configure social network providers.

Finally modify your app views to add links to Social Login using link:

http://yourappurl.com/auth/{socialnetwork}

Examples:

http://yourappurl.com/auth/github
http://yourappurl.com/auth/facebook
http://yourappurl.com/auth/google
http://yourappurl.com/auth/twitter
http://yourappurl.com/auth/linkedin

I recommend you to use AdminLTE Laravel Package for a full working Auth scaffolding with Adminlte bootstrap template. See previous section.

You can also use Laravel default Auth scaffolding running command:

php artisan make:auth

And manually add button/links to social Login/Register.

Usage

You can configure Social Providers with command:

php artisan acacha:social
 Which social network you wish to configure? [Github]:
  [0] Github
  [1] Facebook
  [2] Google
  [3] Twitter
  [4] Linkedin
 > 0
  
  Configuring social network Github...
  Please register a new OAuth app for Github. Go to URL https://github.com/settings/applications/new
  Then ask the following questions:
  
   OAuth client id?:
   > 3a1fg6ac5437f9f4cebd
   
   OAuth client secret?:
   > 5919185e3fb7024e5b10cedce5cce408893224d         
   
   OAuth client redirect URL? [http://localhost:8080/auth/github/callback]:
   > 
   
  File /home/sergi/Code/socialAdminLTEtest/config/services.php updated.
  Github added to config/services.php file
  
   Do you wish to configure other social networks? (yes/no) [yes]: 

This wizard will adapt your .env and config/services.php files to add your social networks OAuth data.

At this moment command php artisan acacha:social will not check if you have already configured your social network so be carefull when executing this command in already configured projects (no errors will be thrown but you will have repeated data in your config files).

Requirements

Please install AdminLTE Laravel:

composer global require "acacha/adminlte-laravel-installer"

This package also requires (all installed using composer):

See also related projects:

Social networks

Laravel social package support by default the following social networks:

  • Github
  • Facebook
  • Google
  • Twitter
  • Linkedin

Laravel social use Illuminate\Support\Manager so you can create your own driver and register the driver in LaravelSocialServiceProvider.

Please, if you create a new driver feel free to create a Pull Request.

You can enable/disable social providers easily. See following section.

Enable/disable social providers

At class LaravelSocialServiceProvider you can modify $enabled field to change enabled social providers. Also remember to changes your views to add/remove action/links to social auth.

Also you have to change static variable $socialNetworks in file ConfigureSocialServicesManager to add your extra social providers.

Github

The cli wizard will propose you to go to page:

https://github.com/settings/applications/new

to register new OAuth Application.

Facebook

The cli wizard will propose you to go to page:

https://developers.facebook.com/apps/

to register new OAuth Application

Google

The cli wizard will propose you to go to page:

https://console.developers.google.com

to register new OAuth Application. Please remember to active Google+ API!.

More info at https://developers.google.com/identity/sign-in/web/devconsole-project .

Twitter

The cli wizard will propose you to go to page:

https://apps.twitter.com/app/new

to register new OAuth Application. Retrieve your api keys at tab Keys and Access Tokens and remember to check Request email addresses from users checkbox active in Permissions tab.

Linkedin

The cli wizard will propose you to go to page:

https://www.linkedin.com/secure/developer

to register new OAuth Application.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

In your Laravel project execute:

$ phpunit tests/AcachaLaravelSocial.php

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email sergiturbadenas@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

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

acacha/laravel-social 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.82k 次下载、GitHub Stars 达 42, 最近一次更新时间为 2017 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「acacha」 「laravel-social」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 5.82k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 43
  • 点击次数: 19
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 42
  • Watchers: 1
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-17