Files
sccs_laravel/app/Http/Resources/UserResource.php
2025-11-04 16:23:40 +05:00

35 lines
892 B
PHP

<?php
namespace App\Http\Resources;
use App\Traits\ImageHelper;
use Illuminate\Http\Resources\Json\JsonResource;
class UserResource extends JsonResource
{
use ImageHelper;
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->name,
'father_name' => $this->father_name,
'email' => $this->email,
'phone' => $this->phone,
'cnic' => $this->cnic,
'dob' => $this->dob,
'gender' => $this->gender,
'picture' => $this->getFileFullUrl($this->picture),
'address' => $this->address,
'notes' => $this->notes
];
}
}