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/syn.corals.io/Corals/modules/Utility/Transformers/Category/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/syn.corals.io/Corals/modules/Utility/Transformers/Category/AttributeTransformer.php
<?php

namespace Corals\Modules\Utility\Transformers\Category;

use Corals\Foundation\Transformers\BaseTransformer;
use Corals\Modules\Utility\Models\Category\Attribute;

class AttributeTransformer extends BaseTransformer
{
    public function __construct($extras = [])
    {
        $this->resource_url = config('utility.models.attribute.resource_url');

        parent::__construct($extras);
    }

    /**
     * @param Attribute $attribute
     * @return array
     * @throws \Throwable
     */
    public function transform(Attribute $attribute)
    {
        $transformedArray = [
            'id' => $attribute->id,
            'checkbox' => $this->generateCheckboxElement($attribute),
            'type' => $attribute->type,
            'label' => $attribute->label,
            'required' => $attribute->required ? '<i class="fa fa-check text-success"></i>' : '-',
            'use_as_filter' => $attribute->use_as_filter ? '<i class="fa fa-check text-success"></i>' : '-',
            'created_at' => format_date($attribute->created_at),
            'updated_at' => format_date($attribute->updated_at),
            'action' => $this->actions($attribute)
        ];

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

Spamworldpro Mini