<commit_before><?php

namespace App\Models;


class VrCategories extends CoreModel
{
    use UuidTrait;

    /**
     * Database table name
     * @var string
     */
    protected $table = 'vr_categories';
    /**
     * Fillable column names
     * @var array
     */
    protected $fillable = ['id', 'comment'];

    protected $with = ['translations'];

    public function translations()
    {

        return $this->hasOne(VrCategoriesTranslations::class, 'record_id', 'id')->where('language_code', app()->getLocale());
    }
}<commit_msg>added language request in model<commit_after><?php

namespace App\Models;


class VrCategories extends CoreModel
{
    use UuidTrait;

    /**
     * Database table name
     * @var string
     */
    protected $table = 'vr_categories';
    /**
     * Fillable column names
     * @var array
     */
    protected $fillable = ['id', 'comment'];

    protected $with = ['translations'];

    public function translations()
    {

        $language = request('language_code');
        if($language == null)
            $language = app()->getLocale();

        return $this->hasOne(VrCategoriesTranslations::class, 'record_id', 'id')->where('language_code',$language);
    }
}
{'fraction_non_alphanumeric': 0.142974527526705, 'fraction_numerical': 0.0, 'mean_word_length': 2.782608695652174, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5256884', 'n_tokens_mistral': 363, 'n_tokens_neox': 346, 'n_words': 83}