Файловый менеджер - Редактировать - /home/clickysoft/public_html/charliapp-v2.clickysoft.net/app/Http/Resources/Admin/CollaboratorDetailResource.php
Назад
<?php namespace App\Http\Resources\Admin; use Illuminate\Http\Resources\Json\JsonResource; class CollaboratorDetailResource extends JsonResource { public function toArray($request) { return [ 'id' => $this->id, 'email' => $this->email, 'role' => $this->role, 'collaboratable_id' => $this->collaboratable_id, 'collaboratable_type' => $this->collaboratable_type, 'created_at' => (new \Carbon\Carbon($this->created_at))->format('F d, Y, H:i:s'), 'updated_at' => (new \Carbon\Carbon($this->updated_at))->format('F d, Y, H:i:s'), 'user' => $this->user, 'owner' => $this->owner, 'collaboratable' => $this->collaboratable->load($this->getRelations($this->collaboratable_type)) ]; } private function getRelations($type) { $arr = []; if ($type == 'brainstorms') { $arr = ['user','book','color','rounds','image']; } elseif ($type == 'outlines') { $arr = ['user','book','color','image','chapters']; } elseif ($type == 'plotlines') { $arr = ['user','book','plot_planner','color']; } elseif ($type == 'timelines') { $arr = ['user','book','color','image','eventTypes']; } return $arr; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка