Open MordiSacks opened 5 years ago
Translatable trait does not handle casts If we have a column that has a casts set for it, it is not casted after translation is loaded
Steps to reproduce the behavior:
protected $casts = ['field' => 'array'];
use Translatable;
$model = $model->translate(app()->getLocale(), 'en')
dd($model->field), expected array, received string.
dd($model->field)
I will try to PR this.
+1
Any idea for a workaround?
Version information
Description
Translatable trait does not handle casts If we have a column that has a casts set for it, it is not casted after translation is loaded
Steps To Reproduce
Steps to reproduce the behavior:
protected $casts = ['field' => 'array'];
on the model.use Translatable;
trait.$model = $model->translate(app()->getLocale(), 'en')
.Expected behavior
dd($model->field)
, expected array, received string.I will try to PR this.