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
We're doing something similar, but our solution was this:
class Item extends Model { protected $with = ['children']; public function children() { $this->hasMany(App\Items::class, 'parent_id', 'id'); } }