5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model;
8 class Technique extends Model
12 public function chapters() {
14 ->belongsToMany(Technique::class, 'technique_chapter', 'parent_id', 'child_id')
15 ->withPivot('level', 'order')
16 ->orderByPivot('order')
17 ->using(TechniqueChapter::class);
20 public function relations() {
22 ->belongsToMany(Technique::class, 'technique_relations', 'from_id', 'to_id')
24 ->using(TechniqueRelation::class);
27 public function translations() {
28 return $this->hasMany(TechniqueTranslation::class);