29 lines
724 B
PHP
29 lines
724 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources\Admin;
|
|
|
|
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,
|
|
'phone' => $this->phone,
|
|
'fullname' => $this->fullname,
|
|
'level' => $this->level,
|
|
'email' => $this->email,
|
|
'created_at' => verta($this->created_at)->format('%d %B %Y %H:%M:%S'),
|
|
'profile_url' => $this->profile_url,
|
|
];
|
|
}
|
|
}
|