jhaoda/socialite-odnoklassniki
Composer 安装命令:
composer require jhaoda/socialite-odnoklassniki
包简介
Odnoklassniki OAuth2 Provider for Laravel Socialite
README 文档
README
1. Installation
composer require jhaoda/socialite-odnoklassniki
2. Service Provider
- Remove
Laravel\Socialite\SocialiteServiceProviderfrom yourproviders[]array inconfig\app.phpif you have added it already. - Add
SocialiteProviders\Manager\ServiceProviderto yourproviders[]array inconfig\app.php.
For example:
'providers' => [ // a whole bunch of providers // remove 'Laravel\Socialite\SocialiteServiceProvider', SocialiteProviders\Manager\ServiceProvider::class, // add ];
- Note: If you would like to use the Socialite Facade, you need to install it.
3. Add the Event and Listeners
-
Add
SocialiteProviders\Manager\SocialiteWasCalled::classevent to yourlisten[]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
JhaoDa\SocialiteProviders\Odnoklassniki\OdnoklassnikiExtendSocialite::class. -
Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.
For example:
/** * The event handler mappings for the application. * * @var array */ protected $listen = [ \SocialiteProviders\Manager\SocialiteWasCalled::class => [ \JhaoDa\SocialiteProviders\Odnoklassniki\OdnoklassnikiExtendSocialite::class ], ];
4. Services Array and .env
Add to config/services.php:
'odnoklassniki' => [ 'client_id' => env('ODNOKLASSNIKI_ID'), 'client_secret' => env('ODNOKLASSNIKI_SECRET'), 'client_public' => env('ODNOKLASSNIKI_PUBLIC'), 'redirect' => env('ODNOKLASSNIKI_REDIRECT'), ],
Append provider values to your .env file:
Note: Add both public and secret keys!
// other values above
ODNOKLASSNIKI_ID=your_app_id_for_the_service
ODNOKLASSNIKI_PUBLIC=your_app_public_for_the_service
ODNOKLASSNIKI_SECRET=your_app_secret_for_the_service
ODNOKLASSNIKI_REDIRECT=https://example.com/login
jhaoda/socialite-odnoklassniki 适用场景与选型建议
jhaoda/socialite-odnoklassniki 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 99.34k 次下载、GitHub Stars 达 41, 最近一次更新时间为 2015 年 04 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 jhaoda/socialite-odnoklassniki 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jhaoda/socialite-odnoklassniki 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 99.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 41
- 点击次数: 10
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-26