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/ledger.corals.io/Corals/core/User/Transformers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/ledger.corals.io/Corals/core/User/Transformers/RoleTransformer.php
<?php

namespace Corals\User\Transformers;

use Corals\Foundation\Transformers\BaseTransformer;
use Corals\User\Models\Role;

class RoleTransformer extends BaseTransformer
{
    public function __construct($extras = [])
    {
        $this->resource_url = config('user.models.role.resource_url');

        parent::__construct($extras);
    }

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

        $transformedArray = [
            'id' => $role->id,
            'name' => $role->name,
            'label' => $role->label,
            'users_count' => $role->users_count,
            'subscription_required' => $role->subscription_required ? '<i class="fa fa-check"></i>' : '-',
            'created_at' => format_date($role->created_at),
            'updated_at' => format_date($role->updated_at),
            'action' => $this->actions($role)
        ];

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

Spamworldpro Mini