ldc-com-app-bo/app/Http/Resources/AppUserResource.php

34 lines
989 B
PHP
Raw Normal View History

<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class AppUserResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
*/
public function toArray($request)
{
//phpcs:enable
return [
'id' => $this->id,
'email' => $this->email,
'surname' => $this->lastname,
'firstname' => $this->firstname,
'password' => $this->password,
'activated' => $this->status,
'role' => ($this->role === 1) ? "TOTAL" : "USER",
'authorizedFolders' => $this->authorizedFolders,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}