Files
investbrain/app/Http/Resources/UserResource.php
T

34 lines
793 B
PHP
Raw Normal View History

2025-01-23 22:47:16 -06:00
<?php
2025-01-24 19:24:16 -06:00
declare(strict_types=1);
2025-01-23 22:47:16 -06:00
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class UserResource extends JsonResource
2025-01-28 17:14:49 -06:00
{
2025-01-23 22:47:16 -06:00
/**
* 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,
'profile_photo_url' => $this->profile_photo_url,
'options' => [
'display_currency' => $this->getCurrency(),
'locale' => $this->getLocale(),
],
2025-01-23 22:47:16 -06:00
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}