]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/Technique.php
tech title icons
[alttp.git] / app / Models / Technique.php
index 1a54a0e1b29767f6f7ce29d1efc485ec1b17328d..2eb0a941125434b8b68712f11ad3d2c164a08209 100644 (file)
@@ -17,7 +17,26 @@ 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',
+               'title_icons' => 'array',
+       ];
+
+       protected $with = [
+               'translations',
        ];
+
 }