34 lines
1.0 KiB
PHP
34 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources\SuperAdmin;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class SuperAdminUserResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->uuid,
|
|
'db_id' => $this->id,
|
|
'email' => $this->email,
|
|
'phone' => $this->phone,
|
|
'first_name' => $this->first_name,
|
|
'middle_name' => $this->middle_name,
|
|
'last_name' => $this->last_name,
|
|
'full_name' => $this->full_name,
|
|
'role' => $this->role,
|
|
'status' => $this->status,
|
|
'preferred_language' => $this->preferred_language,
|
|
'avatar_path' => $this->avatar_path,
|
|
'tenant' => $this->tenant ? [
|
|
'id' => $this->tenant->uuid,
|
|
'name' => $this->tenant->name,
|
|
'code' => $this->tenant->code,
|
|
] : null,
|
|
'created_at' => $this->created_at?->toIso8601String(),
|
|
];
|
|
}
|
|
}
|