2025-12-25 06:33:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
2026-01-20 20:58:32 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2025-12-25 06:33:21 +01:00
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
|
2026-01-20 20:58:32 +01:00
|
|
|
use App\Models\User;
|
2025-12-25 06:33:21 +01:00
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
|
|
|
|
|
|
/**
|
2026-01-20 20:58:32 +01:00
|
|
|
* @mixin User
|
2025-12-25 06:33:21 +01:00
|
|
|
*/
|
2026-01-20 20:58:32 +01:00
|
|
|
final class UserResource extends JsonResource
|
2025-12-25 06:33:21 +01:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @return array<string, mixed>
|
|
|
|
|
*/
|
|
|
|
|
public function toArray(Request $request): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'id' => $this->id,
|
|
|
|
|
'name' => $this->name,
|
|
|
|
|
'email' => $this->email,
|
|
|
|
|
'email_verified_at' => $this->email_verified_at?->toIso8601String(),
|
|
|
|
|
'created_at' => $this->created_at?->toIso8601String(),
|
|
|
|
|
'updated_at' => $this->updated_at?->toIso8601String(),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|