first commit
This commit is contained in:
33
app/Http/Resources/UserResource.php
Normal file
33
app/Http/Resources/UserResource.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user