Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

How to set translations to Model for all languages #139

Open
ludmanp opened this issue Sep 3, 2018 · 3 comments
Open

How to set translations to Model for all languages #139

ludmanp opened this issue Sep 3, 2018 · 3 comments

Comments

@ludmanp
Copy link

ludmanp commented Sep 3, 2018

Is tere any possibility to set attribute values for different languages before save?

For example something like
$page = new \App\Page();
$page->title = ['en'=>'title', 'es'=>'title1'];
$page->save();

@AttilaSzendi
Copy link

@ludmanp Have you found the solution for your problem? It would be great.

@ludmanp
Copy link
Author

ludmanp commented Dec 4, 2018

It seems, that the best way is to do something like
$model->title = json_encode(['en'=>'title', 'es'=>'title1']);

@AttilaSzendi
Copy link

It seems, that the best way is to do something like
$model->title = json_encode(['en'=>'title', 'es'=>'title1']);

It is a good idea. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants