37 lines
1.3 KiB
PHP
37 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\Schedule;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
/** @mixin Schedule */
|
|
class ScheduleResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'start' => $this->start,
|
|
'ends' => $this->ends,
|
|
'stream_id' => $this->stream_id,
|
|
'clip_lenght' => $this->clip_lenght,
|
|
'fade_in' => $this->fade_in,
|
|
'fade_out' => $this->fade_out,
|
|
'cue_in' => $this->cue_in,
|
|
'cue_out' => $this->cue_out,
|
|
'media_item_played' => $this->media_item_played,
|
|
'playout_status' => $this->playout_status,
|
|
'broadcasted' => $this->broadcasted,
|
|
'position' => $this->position,
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
|
|
'cc_file_id' => $this->cc_file_id,
|
|
'cc_show_instance_id' => $this->cc_show_instance_id,
|
|
|
|
'ccShowInstance' => new ShowInstancesResource($this->whenLoaded('ccShowInstance')),
|
|
];
|
|
}
|
|
}
|