public function testGetAllRoot() { $items = CategoryNested::getAllRoot(); // Not eager loaded $items->each(function ($item) { $this->assertFalse($item->relationLoaded('children')); }); $this->assertEquals(2, $items->count()); }