Replies: 2 comments
-
I am guessing you solved this by now, I was looking into doing the same thing.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I would suggest using the getRawOriginal() method as a cleaner solution, like: use App\Models\Page;
$pages = Page::all();
foreach ($pages as $page) {
$page->setTranslation('title', 'en', $page->getRawOriginal('title'))->save();
} Change the 'Page' model with your desired model. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i'm trying to convert and existing text column to translatable. I find that when i add the column name to the the protected translatable array i am no longer able to access it as i did before ($model->key)
I assume that this is because its looked for a translation but can't find one. Is there a way for me to return to contents of the column? I want to retrieve the text and and replace it with a json
Beta Was this translation helpful? Give feedback.
All reactions