| Conditions | 3 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function toArray($request): array |
||
| 24 | { |
||
| 25 | /** @var Category $this */ |
||
| 26 | return [ |
||
| 27 | 'id' => $this->id, |
||
| 28 | 'name' => $this->name, |
||
| 29 | 'slug' => $this->slug instanceof Slug ? $this->slug->key : $this->slug, |
||
|
|
|||
| 30 | 'icon' => $this->icon ? BaseHelper::renderIcon($this->icon) : null, |
||
| 31 | 'description' => $this->description, |
||
| 32 | 'children' => CategoryResource::collection($this->children), |
||
| 33 | 'parent' => new CategoryResource($this->parent), |
||
| 34 | ]; |
||
| 37 |