public function testGetNested() { $items = CategoryNested::getNested(); // Eager loaded $items->each(function ($item) { $this->assertTrue($item->relationLoaded('children')); }); $this->assertEquals(2, $items->count()); }