承接 akkyoh/socialite_github 相关项目开发

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

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

akkyoh/socialite_github

Composer 安装命令:

composer require akkyoh/socialite_github

包简介

Github OAuth2 Provider for Laravel Socialite

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version

Install

1. COMPOSER

composer require akkyoh/socialite_github

2. SERVICE PROVIDER

  • Remove Laravel\Socialite\SocialiteServiceProvider from your providers[] array in config\app.php if you have added it already.
  • Add \SocialiteProviders\Manager\ServiceProvider::class to your providers[] array in config\app.php.
// For example
'providers' => [
    // a whole bunch of providers
    // remove 'Laravel\Socialite\SocialiteServiceProvider',
    \SocialiteProviders\Manager\ServiceProvider::class, // add
];
  • If you would like to use the Socialite Facade, you need to install it.

3. ADD THE EVENT AND LISTENERS

  • Add SocialiteProviders\Manager\SocialiteWasCalled event to your listen[] array in <app_name>/Providers/EventServiceProvider.
  • Add your listeners (i.e. the ones from the providers) to the SocialiteProviders\Manager\SocialiteWasCalled[] that you just created.
  • The listener that you add for this provider is 'Akkyoh\SocialiteGithub\GithubExtendSocialite@handle',.
  • Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.
// For example
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // add your listeners (aka providers) here
        'Akkyoh\SocialiteGithub\GithubExtendSocialite@handle',
    ],
];

4. ENVIRONMENT VARIABLES

If you add environment values to your .env as exactly shown below, you do not need to add an entry to the services array.

APPEND PROVIDER VALUES TO YOUR .ENV FILE
// other values above
GITHUB_KEY=yourkeyfortheservice
GITHUB_SECRET=yoursecretfortheservice
GITHUB_REDIRECT_URI=https://example.com/login
ADD TO CONFIG/SERVICES.PHP.

You do not need to add this if you add the values to the .env exactly as shown above. The values below are provided as a convenience in the case that a developer is not able to use the .env method

'github' => [
    'client_id' => env('GITHUB_KEY'),
    'client_secret' => env('GITHUB_SECRET'),
    'redirect' => env('GITHUB_REDIRECT_URI'),
],

USAGE

You should now be able to use it like you would regularly use Socialite (assuming you have the facade installed):

return Socialite::driver('github') -> redirect();

RESOURCES

Socialite Providers Laravel Socialite Docs

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-07-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固