socialiteproviders/etsy 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

socialiteproviders/etsy

最新稳定版本:5.0.1

Composer 安装命令:

composer require socialiteproviders/etsy

包简介

EtsyV3 OAuth2 Provider for Laravel Socialite

README 文档

README

Support for OpenAPI v3 on Etsy.

Note: V2 is scheduled to sunset Q4 2022.

Installation & Basic Usage

composer require socialiteproviders/etsy

Add configuration to config/services.php

'etsy' => [    
  'client_id' => env('ETSY_CLIENT_ID'),  
  'client_secret' => env('ETSY_CLIENT_SECRET'),  
  'redirect' => env('ETSY_REDIRECT_URI') 
],

Add variables to .env

You can find/update this information from https://www.etsy.com/developers/your-apps

ETSY_CLIENT_ID={YOUR API KEY}
ETSY_CLIENT_SECRET={YOUR SECRET}
ETSY_REDIRECT_URI=https://example.com/callback

Laravel 11+

In Laravel 11, the default EventServiceProvider provider was removed. Instead, add the listener using the listen method on the Event facade, in your AppServiceProvider boot method.

Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
    $event->extendSocialite('etsy', \SocialiteProviders\Etsy\Provider::class);
});
Laravel 10 or below Add provider event listener `app/Providers/EventServiceProvider`

Configure the package's listener to listen for SocialiteWasCalled events.

Add the event to your listen[] array in app/Providers/EventServiceProvider. See the Base Installation Guide for detailed instructions.

protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\Etsy\EtsyExtendSocialite::class.'@handle',
    ],
];

Usage web/routes.php

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

Note: The email_r is enabled by default so you can access user information in the callback.

// the redirect
return Socialite::driver('etsy')
        ->scopes[['include', 'scopes', 'here']]  
        ->redirect();

// the callback
$etsyUser = Socialite::driver('etsy')
        ->user();

Returned User fields

  • id
  • nickname
  • name
  • email
  • avatar

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-18