Skip to content

Commit 9fd3ff2

Browse files
author
Tihomir Banov
committed
Add Translation change Eloquent method from insert to create
1 parent b76118a commit 9fd3ff2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ class Contacts extends Eloquent
8989
class ContactsI18n extends Eloquent
9090
{
9191
protected $table = 'contacts_i18n';
92+
93+
protected $fillable = ['contact_id', 'i18n_id', 'name', 'location'];
9294
}
9395
```
9496
## View example

src/Despark/LaravelDbLocalization/i18nModelTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function saveTranslations($translatableId, $options)
215215
$translationModel = new $this->translator();
216216

217217
foreach ($translationsArray as $translationValues) {
218-
$translationModel->insert($translationValues);
218+
$translationModel->create($translationValues);
219219
}
220220
}
221221

0 commit comments

Comments
 (0)