Laravel Voyager新用户登录时出现非法字符串偏移'locale'错误

问题描述 投票:1回答:2

我正在使用Laravel Voyager作为我的网络应用程序。

当我添加新的贡献者用户并尝试进入他的仪表板时。我收到了“非法字符串偏移'locale'”错误。

错误路径:/home/turongro/public_html/vendor/tcg/voyager/src/Models/User.php

错误行:

public function getLocaleAttribute()
{
    return $this->settings['locale'];
}

在收到此错误之前,我在config / app.php中更改了'locale' => 'ru'

php laravel voyager
2个回答
2
投票

this issue reply中所述,您可以在settings中的强制转换中添加app/User.php字段:

protected $casts = [
  'email_verified_at' => 'datetime',
  'settings' => 'json'
];

0
投票

你有没有尝试过?

php artisan config:cache

php artisan cache:清楚

© www.soinside.com 2019 - 2024. All rights reserved.