Файловый менеджер - Редактировать - /home/clickysoft/public_html/jmapi5.clickysoft.net/app/Http/Resources/User/CategoryTreeResource.php
Назад
<?php namespace App\Http\Resources\User; use Illuminate\Http\Resources\Json\JsonResource; class CategoryTreeResource extends JsonResource { public function toArray($request) { $child_categories = []; foreach ($this->categoryTree as $tree){ $child_categories[] = [ 'id' => $tree->id, 'name' => $tree->name, 'featured_image' => $tree->featured_image ? [ 'url' => $tree->featured_image->url, 'thumbnail' => $tree->featured_image->thumbnail, 'preview' => $tree->featured_image->preview, ] : null, ]; } return [ 'id' => $this->id, 'name' => $this->name, 'featured_image' => $this->featured_image ? [ 'url' => $this->featured_image->url, 'thumbnail' => $this->featured_image->thumbnail, 'preview' => $this->featured_image->preview, ] : null, 'child_categories' => $child_categories, ]; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка