26 lines
669 B
PHP
26 lines
669 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\Show\ShowRebroadcast;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
/** @mixin ShowRebroadcast */
|
|
class ShowRebroadcastResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'day_offset' => $this->day_offset,
|
|
'start_time' => $this->start_time,
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
|
|
'show_id' => $this->show_id,
|
|
|
|
'show' => new ShowResource($this->whenLoaded('show')),
|
|
];
|
|
}
|
|
}
|