mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-14 09:01:42 -04:00
40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\StudioPlus\Transformers;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class ContentWatermarkDatabaseResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'contentType' => $this->whenLoaded('contentType'),
|
|
'contentVariant' => $this->whenLoaded('contentVariant'),
|
|
'type' => [
|
|
'name' => ucfirst($this->type),
|
|
'value' => $this->type
|
|
],
|
|
'watermark' => $this->watermark,
|
|
'inTime' => $this->in_time,
|
|
'inDuration' => $this->in_duration,
|
|
'outTime' => $this->out_time,
|
|
'outDuration' => $this->out_duration,
|
|
'left' => $this->left,
|
|
'top' => $this->top,
|
|
'right' => $this->right,
|
|
'bottom' => $this->bottom,
|
|
'active' => $this->active ? true : false,
|
|
'key' => $this->updated_at->format('YmdHis'),
|
|
'watermarkUrl' => $this->watermark_url
|
|
];
|
|
}
|
|
}
|