Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 Laravel 3 或 4 进行自我加入?
class Category extends Eloquent { public function category () { return $this->has_one('Category'); } }
如果你的表category_id中有一个列Category,这应该可以正常工作,递归。
category_id
Category