InvalidArgumentException with message 'Driver [weixin] not supported.'?

执行 $driver = Socialite::driver('weixin');
报错 InvalidArgumentException with message 'Driver [weixin] not supported.'
是什么原因呢

《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
liyu001989
最佳答案

配置不对,可能是 event 那里没有添加对

5年前 评论
pi_phq 3年前
讨论数量: 7
liyu001989

配置不对,可能是 event 那里没有添加对

5年前 评论
pi_phq 3年前

@liyu001989 我EventServiceProvider里已经设置了
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
// add your listeners (aka providers) here
'SocialiteProviders\Weixin\WeixinExtendSocialite@handle'
],
];
还是出错

5年前 评论
curry丶 4年前
liyu001989

确定一下socialiteproviders/weixin 安装成功了没,退出重新启动tinker,执行命令截个图看看吧。

5年前 评论

@liyu001989

安装成功了的,这是报错

file

再安装已经没有内容需要安装了,还是报错

file

5年前 评论

@liyu001989
这是EventServiceProvider.php

file

5年前 评论

@liyu001989
我搞错了,我sublime text打开的项目是其他项目,我就说怎么改都错。。不好意思了,非常感谢你的帮助

5年前 评论
mouyong

@liyu001989 @overtrue 当项目同时安装了 overtrue/laravel-socialitesocialiteproviders/weixin 时,因 overtrue/laravel-socialite 的 composer.json 中定义了 aliases,tinker 会抛出错误:Driver [weixin] not supported.

4年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!