Pharaonic
Loading...

# Attributes

locales

Returns array of locales codes.

# translateOrNew

Update the translation or create a new one.

1$post->translateOrNew('en')->title = 'Something Here';
2$post->save();

# translateOrDefault

Getting the translation or the default translation.

1echo $post->translateOrDefault('en')->title;

# translateOrFail

Getting the translation or abort.

1echo $post->translateOrFail('en')->title;

# translate

Getting the translation.

1echo $post->translate('en')->title;

# hasTranslation

Checking if the model has been translated in a specific locale or not.

1if($post->hasTranslation('en')) {
2 //
3}