Skip to content
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 

README.md

Laravel Socialite

Laravel 第三方登录,支持微信、QQ。

安装

使用 composer 命令

composer require weann/socialite

注册服务提供者

Weann\Socialite\SocialiteServiceProvider::class,

注册 Facade

'Socialite' => Weann\Socialite\Facades\Socialite::class,

使用

配置文件 config/services.php

'wechat' => [
    'client_id' => 'APP_ID',
    'client_secret' => 'APP_SECRET',
    'redirect' => 'CALLBACK_URL'
],

将用户重定向到授权页面。

Route::get('/', function () {
    return Socialite::driver('wechat')->redirect();
});

授权后的回调。

Route::get('callback', function () {
    $user = Socialite::driver('wechat')->user()
    dd($user);
});

About

Laravel 第三方登录,支持微信、QQ。

Resources

Languages

You can’t perform that action at this time.