Restore local changes after Git corruption

This commit is contained in:
root
2026-01-10 07:00:36 +00:00
parent 395bfa5e75
commit 915b4fe95d
20 changed files with 1453 additions and 75 deletions

View File

@@ -11,29 +11,24 @@ class Component extends Model
protected $fillable = [
'name',
'component_type_id',
'price',
'component_type_id',
'specifications',
'is_official',
'created_by_user_id',
];
protected $casts = [
'specifications' => 'array', // Автоматически преобразует JSON в массив
'is_official' => 'boolean',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'specifications' => 'array', // автоматически преобразует JSON в массив
];
// Связь с типом компонента
public function type()
{
return $this->belongsTo(ComponentType::class, 'component_type_id');
}
// Связь с пользователем (если добавил пользователь)
public function createdBy()
public function user()
{
return $this->belongsTo(User::class, 'created_by_user_id');
}
public function componentType()
{
return $this->belongsTo(ComponentType::class, 'component_type_id');
}
}