I\'m working on a project in Laravel. I have an Account model that can have a parent or can have children, so I have my model set up like so:
public
public function childrenAccounts() { return $this->hasMany('Account', 'act_parent', 'act_id')->with('childrenAccounts'); }
This code returns all children accounts (recurring)