我正在使用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'
如this issue reply中所述,您可以在settings
中的强制转换中添加app/User.php
字段:
protected $casts = [
'email_verified_at' => 'datetime',
'settings' => 'json'
];
你有没有尝试过?
php artisan config:cache
php artisan cache:清楚