belongsTo(DictSection::class, 'section_id'); } // Родительское значение (для иерархий: модель → марка) public function parent(): BelongsTo { return $this->belongsTo(DictValue::class, 'parent_id'); } // Дочерние значения (для иерархий: марка → список моделей), отсортированные по sort_order public function children(): HasMany { return $this->hasMany(DictValue::class, 'parent_id')->orderBy('sort_order'); } }