我正在为我的网络应用程序使用 Laravel Voyager。
当我添加新的贡献者用户并尝试进入他的仪表板时。我收到“非法字符串偏移‘区域设置’”错误。
错误路径:/home/turongro/public_html/vendor/tcg/voyager/src/Models/User.php
错误行:
public function getLocaleAttribute()
{
return $this->settings['locale'];
}
在出现此错误之前,我在 config/app.php 中更改了 'locale' => 'ru'
最佳答案
如 this issue reply 中所述,您可以在 app/User.php
内的强制转换中添加 settings
字段:
protected $casts = [
'email_verified_at' => 'datetime',
'settings' => 'json'
];
关于php - Laravel Voyager 新用户登录时出现非法字符串偏移 'locale' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54759547/