peterguo 2 tháng trước cách đây
mục cha
commit
b9c6b44e16
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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');