首页 > 解决方案 > Laravel Voyager 新用户登录中的非法字符串偏移“区域设置”错误

问题描述

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

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

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

错误行:

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

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

标签: phplaravelvoyager

解决方案


本期回复settings中所述,您可以在里面的演员表中添加字段app/User.php

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

推荐阅读