Prechádzať zdrojové kódy

Merge branch 'refs/heads/peterguo-dev' into dev

peterguo 3 mesiacov pred
rodič
commit
7dcd115c8f
1 zmenil súbory, kde vykonal 5 pridanie a 0 odobranie
  1. 5 0
      app/Models/File.php

+ 5 - 0
app/Models/File.php

@@ -66,6 +66,11 @@ class File extends Model
         return $this->belongsTo(Container::class, 'object_id');
     }
 
+    public function containerLibrary(): HasOneThrough
+    {
+        return $this->hasOneThrough(Library::class, Container::class, 'id', 'id', 'object_id', 'library_id');
+    }
+
     public function library(): HasOneThrough
     {
         return $this->hasOneThrough(Library::class, Container::class, 'id', 'id', 'object_id', 'library_id');