Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Translation wrapper for multiple translations #437

Open
MohamedAbdel-wahed opened this issue Dec 1, 2024 · 0 comments
Open

Translation wrapper for multiple translations #437

MohamedAbdel-wahed opened this issue Dec 1, 2024 · 0 comments
Labels

Comments

@MohamedAbdel-wahed
Copy link

MohamedAbdel-wahed commented Dec 1, 2024

when i set transaltion wrapper in the config file to 'translations' and i want to use it like this:
Post::create([
'user_id'=> $id,
'translations'=> [
'en'=> ['title' => 'test title],
'ar' => 'title'=> 'test arabic title'
]
]);

it gives me unknonw column 'translations' ❗️

in PostTranslation model
i am using fillable= ['post_id', 'title']

this works ✅:
Post::create([
'user_id'=> $id,
'en'=> ['title' => 'test title],
'ar' => 'title'=> 'test arabic title'
]);

this doesn't work ❌:
Post::create([
'user_id'=> $id,
'translations'=> [
'en'=> ['title' => 'test title],
'ar' => 'title'=> 'test arabic title'
]
]);

i am using laravel 11

thank you

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

No branches or pull requests

1 participant