Kaynağa Gözat

add channels

visuddhinanda 11 ay önce
ebeveyn
işleme
fe5c2ea10e
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 6 0
      api-v8/app/Models/UserInfo.php

+ 6 - 0
api-v8/app/Models/UserInfo.php

@@ -10,4 +10,10 @@ class UserInfo extends Model
     use HasFactory;
     protected $primaryKey = 'id';
     public  $incrementing = true;
+
+    // 可选:定义反向关联
+    public function channels()
+    {
+        return $this->hasMany(Channel::class, 'owner_id', 'userid');
+    }
 }