|
@@ -31,6 +31,9 @@ class AssetResource extends JsonResource
|
|
|
'longitude' => $this->longitude,
|
|
|
'parent_id' => $this->parent_id,
|
|
|
'level' => count(explode(",", trim($this->path, ","))),
|
|
|
+ 'requirement_total' => $this->total_requirements_count,
|
|
|
+ 'plan_total' => $this->total_plans_count,
|
|
|
+ 'created_at'=> $this->created_at,
|
|
|
'children' => $this->when($this->children->isNotEmpty(), function () {
|
|
|
return $this->children->map(function ($child) {
|
|
|
return new AssetResource($child, $this->level);
|