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

added locales method #361

Merged
merged 1 commit into from
Oct 21, 2022
Merged

added locales method #361

merged 1 commit into from
Oct 21, 2022

Conversation

ahmetbarut
Copy link
Contributor

Newly added method: locales returns all locales used by a model so it's easier to check what translations are there.

    $model->setTranslation('name', 'en', 'testValue_en');
    $model->setTranslation('name', 'fr', 'testValue_fr');
    $model->setTranslation('name', 'tr', 'testValue_tr');
    $model->save();
    
    
    $model->refresh()->locales();
    // ['en', 'fr', 'tr']

@mnkincir
Copy link

It is an important situation so that we can more easily see in which languages the content is added.

@freekmurze freekmurze merged commit b0ee6e0 into spatie:main Oct 21, 2022
@freekmurze
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants