laravel-polyglot-model

Quick Example

use PolyglotModel\Traits\HasTranslations;

class Post extends Model
{
    use HasTranslations;

    protected array $translatableFields = ['title', 'content'];
}

// Set translations
$post->setTranslate('title', 'tr', 'Merhaba Dünya');

// Get translations (magic getter)
App::setLocale('tr');
echo $post->title; // "Merhaba Dünya"