Файловый менеджер - Редактировать - /home/clickysoft/public_html/charliapp-v2.clickysoft.net/app/Http/Resources/Admin/CalendarViewResource.php
Назад
<?php namespace App\Http\Resources\Admin; use Illuminate\Http\Resources\Json\JsonResource; class CalendarViewResource extends JsonResource { /** * Transform the resource into an array. * * @param \Illuminate\Http\Request $request * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable */ public function toArray($request) { // return parent::toArray($request); $formattedEventDate = \Carbon\Carbon::parse($this->event_date)->format('F d, Y'); $formattedStartTime = \Carbon\Carbon::parse($this->start_time)->format('g:i a'); $formattedEndTime = \Carbon\Carbon::parse($this->end_time)->format('g:i a'); // $startDateTime = \Carbon\Carbon::parse($this->event_date . ' ' . $this->start_time)->toDateTimeString(); // $endDateTime = \Carbon\Carbon::parse($this->event_date . ' ' . $this->end_time)->toDateTimeString(); $color = $this->tag ? $this->tag->color : null; // Assuming 'tag' is a relation and 'color' is a property on the tag model return [ 'id' => $this->id, 'type' => $this->type, 'title' => $this->title, 'description' => $this->description, 'location' => $this->location, 'event_date' => $formattedEventDate, 'start_time' => $formattedStartTime, 'end_time' => $formattedEndTime, 'end_date'=>$this->end_date, 'tag_id'=>$this->tag_id, 'color_id' => $this->color_id, 'color' => $color, 'color_code' => $this->color_code, 'foreground_color' => $this->foreground_color, ]; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка