$this->id, 'name' => $this->name, 'cover' => $this->cover, 'director' => $this->director, 'area' => $this->area, 'description' => $this->description, 'category_id' => $this->category_id, 'category_name' => $this->whenLoaded('category', function () { return $this->category->name; }, ''), 'category' => RegionCategoryResource::make($this->whenLoaded('category')), 'current_plant' => RegionPlantResource::make($this->whenLoaded('currentPlant')), 'position_x'=> $this->position_x, 'position_y'=> $this->position_y, 'canvasbox'=> '1350,900', 'monitor_modes' => MonitorModeResource::collection($this->whenLoaded('monitorModes')), ]; } }