35 lines
892 B
PHP
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
|
|
];
|
|
}
|
|
}
|