X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=app%2FModels%2FTechnique.php;h=446967125c8e98ebad935fb2a45d20cbeed1ada7;hb=f1c8c3cc53a09d1c261875d2f482b6e19bc48a9a;hp=256afc06ea6abe051e47fa08ae39b421e43950f9;hpb=6f34dd7c00bf0bd152a97b175390be00c3a0ba31;p=alttp.git diff --git a/app/Models/Technique.php b/app/Models/Technique.php index 256afc0..4469671 100644 --- a/app/Models/Technique.php +++ b/app/Models/Technique.php @@ -17,12 +17,21 @@ class Technique extends Model ->using(TechniqueChapter::class); } + public function relations() { + return $this + ->belongsToMany(Technique::class, 'technique_relations', 'from_id', 'to_id') + ->withPivot('type') + ->using(TechniqueRelation::class); + } + public function translations() { return $this->hasMany(TechniqueTranslation::class); } protected $casts = [ 'index' => 'boolean', + 'requirements' => 'array', + 'rulesets' => 'array', ]; protected $with = [