34 lines
907 B
PHP
34 lines
907 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Traits\ImageHelper;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class UserResource extends JsonResource
|
|
{
|
|
use ImageHelper;
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
"id" => $this->id,
|
|
"name" => $this->name,
|
|
"email" => $this->email,
|
|
"country_code" => $this->country_code,
|
|
"phone" => $this->phone,
|
|
"image" => $this->getFileFullUrl($this->image),
|
|
"type" => $this->type,
|
|
"email_verified_at" => $this->email_verified_at,
|
|
"phone_verified_at" => $this->phone_verified_at,
|
|
"status" => $this->status,
|
|
"status_reason" => $this->status_reason,
|
|
];
|
|
}
|
|
}
|