Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/job-board.corals.io/Corals/modules/Reservation/Transformers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/job-board.corals.io/Corals/modules/Reservation/Transformers/ServiceTransformer.php
<?php

namespace Corals\Modules\Reservation\Transformers;

use Corals\Foundation\Transformers\BaseTransformer;
use Corals\Modules\Reservation\Models\Service;

class ServiceTransformer extends BaseTransformer
{
    public function __construct($extras = [])
    {
        $this->resource_url = config('reservation.models.service.resource_url');

        parent::__construct($extras);
    }

    /**
     * @param Service $service
     * @return array
     * @throws \Throwable
     */
    public function transform(Service $service)
    {
        $transformedArray = [
            'id' => $service->id,

            'name' => HtmlElement('a', ['href' => $service->getShowURL()], $service->name),
            'code' => HtmlElement('a', ['href' => $service->getShowURL()], $service->code),
            'owner_type' => $service->owner_type,
            'owner' => $service->owner->present('name'),

            'object_type' => $service->object_type ?? '-',

            'status' => formatStatusAsLabels($service->status),
            'slot_in_minutes' => $service->slot_in_minutes ?? '-',
            'can_be_cancelled_before' => $service->can_be_cancelled_before ?? '-',
            'description' => $service->description ?? '-',

            'created_at' => format_date($service->created_at),
            'updated_at' => format_date($service->updated_at),
            'action' => $this->actions($service)
        ];

        return parent::transformResponse($transformedArray);
    }
}

Spamworldpro Mini