37 lines
1.1 KiB
PHP
Executable File
37 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\User\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class UserResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'username' => $this->username,
|
|
'email' => $this->email,
|
|
'first_name' => $this->first_name,
|
|
'last_name' => $this->last_name,
|
|
'national_id' => $this->national_id,
|
|
'address' => $this->address,
|
|
'postal_code' => $this->postal_code,
|
|
'phone_number' => $this->phone_number,
|
|
'province_id' => $this->province_id,
|
|
'province_name' => $this->province_name,
|
|
'city_id' => $this->city_id,
|
|
'city_name' => $this->city_name,
|
|
'birth_date' => $this->birth_date,
|
|
'kyc_status' => $this->kyc_status,
|
|
'authority_level' => $this->authority_level,
|
|
];
|
|
}
|
|
}
|