classify admin

This commit is contained in:
Husanjonazamov
2026-02-24 12:52:01 +05:00
commit e0f1989655
769 changed files with 1263008 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Throwable;
class CustomFieldsTranslation extends Model
{
use HasFactory;
protected $table = 'custom_fields_translations';
protected $fillable = [
'custom_field_id',
'language_id',
'name',
'value',
];
/**
* Get the custom field that owns this translation.
*/
public function customField()
{
return $this->belongsTo(CustomField::class);
}
/**
* Get the language for this translation.
*/
public function language()
{
return $this->belongsTo(Language::class);
}
public function getValueAttribute($value) {
try {
return array_values(json_decode($value, true, 512, JSON_THROW_ON_ERROR));
} catch (Throwable) {
return $value;
}
}
}