$this->id, 'name'=>$this->name, 'path' => $this->path, 'parent_asset'=>$this->when($this->parent !== null, function () { return[ new AssetParentResource($this->parent) ]; }), ]; } }