bewaternow / sanctum-mongo

官方自带的已经很好,但是我需要一个对mongo友好的。
Other
7 stars 0 forks source link

使用默认的数据库驱动为mongo之后 用了 auth:sanctum 中间件之后 报错 Illegal offset type #2

Open hadeswang2016 opened 1 year ago

hadeswang2016 commented 1 year ago

image

bewaternow commented 1 year ago

Give me more info to help u.

hadeswang2016 commented 1 year ago

新创建的laravel项目 项目中只用了 mongodb 然后按照 文档 这里的readme 步骤操作了一下 然后 写了个路由如下 Route::group(['middleware' => ['auth:sanctum']], function () { Route::get('systemUser/index', [SystemUserController::class, 'index']); }); 然后访问提示如上报错 php版本:PHP 7.4.30 laravel版本:Laravel Framework 8.83.27

hadeswang2016 commented 1 year ago

知道了 可能是laravel版本问题 vendor\zach\sanctum-mongo\src\Guard.php 文件里 image 截图中红框里面的是数组 导致的 改成字符串就好了

bewaternow commented 1 year ago

ok,牛逼!