fix sort order sidebar menu and percentage bigdata resume

This commit is contained in:
arifal
2025-09-12 11:22:18 +07:00
parent e577da737b
commit e265e2ec35
4 changed files with 22 additions and 16 deletions

View File

@@ -22,6 +22,11 @@ class MenuResource extends JsonResource
'url' => $this->url,
'sort_order' => $this->sort_order,
'parent' => $this->parent ? new MenuResource($this->parent) : null,
'children' => $this->when($this->relationLoaded('children'), function () {
return $this->children->sortBy('sort_order')->map(function ($child) {
return new MenuResource($child);
});
}),
'created_at' => $this->created_at,
'updated_at' => $this->updated_at
];