Relies on Rainlab.User
Settings > Misc > Weixin Login set the appid and secret of Offical Account and Open Platform
Authorize url: [your domain]/beysong/wechat/auth
Authorize url: [your domain]/beysong/wechat/open
After authorize successfully, the user account will bind the Wechat User by openid If the user account has logined in. Otherwhise the bind action will execute after the user accout login. The user can login by Wechat Authorize next time.
Just fill share data
- install the plugin:
php artisan plugin:install Beysong.Wechat
orcomposer require beysong/wechat-plugin
- Add the below code to any where you want
<a href="/beysong/wechat/auth?r=/redirect_url">Offical Account Login</a> or
<a href="/beysong/wechat/open?r=/redirect_url">Open Platform Login</a>
the params 'r' for binded user redirect url.