<commit_before><?php

namespace App;
use Illuminate\Database\Eloquent\Model;
use Ramsey\Uuid\Uuid;


class VRCategories extends CoreModel
{
    protected $table = 'vr_categories';

    protected $fillable = ['id'];


    protected static function boot() {
        Model::boot();
        static::creating(function($model) {
            if(!isset($model->attributes['id'])) {
                $model->attributes['id'] = Uuid::uuid4();
            } else {
                $model->{$model->getKeyName()} = $model->attributes['id'];
            }
        });
    }
}
<commit_msg>public function translation()<commit_after><?php

namespace App;
use Illuminate\Database\Eloquent\Model;
use Ramsey\Uuid\Uuid;


class VRCategories extends CoreModel
{
    protected $table = 'vr_categories';

    protected $fillable = ['id'];

    protected $with = ['translation'];

    protected static function boot() {
        Model::boot();
        static::creating(function($model) {
            if(!isset($model->attributes['id'])) {
                $model->attributes['id'] = Uuid::uuid4();
            } else {
                $model->{$model->getKeyName()} = $model->attributes['id'];
            }
        });
    }

    public function translation()
    {
        $lang = app()->getLocale();
        return $this->hasOne(VRCategoriesTranslations::class, 'record_id', 'id')->where('language_code', $lang);
    }
}

{'fraction_non_alphanumeric': 0.1658327376697641, 'fraction_numerical': 0.0014295925661186562, 'mean_word_length': 2.58974358974359, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5688666', 'n_tokens_mistral': 405, 'n_tokens_neox': 398, 'n_words': 73}