parent 关联疑惑?
老师,我们之前写关联,外键对应的 表名_id
,而这里外键不是这样的,而是parent_id
,这里的关联写法有点看不懂?
public function parent() { return $this->belongsTo(Category::class); }
推荐文章: