feat(backend): complete Module 1 auth (register/login/OTP/reset)
Closes Module 1: 9 auth endpoints under /api/v1/auth, OTP via SMS (Semaphore + log + fake drivers), role middleware, role + admin seeders, 27 feature tests passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
app/Http/Resources/UserResource.php
Normal file
27
app/Http/Resources/UserResource.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class UserResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->uuid,
|
||||
'email' => $this->email,
|
||||
'phone' => $this->phone,
|
||||
'first_name' => $this->first_name,
|
||||
'middle_name' => $this->middle_name,
|
||||
'last_name' => $this->last_name,
|
||||
'role' => $this->role,
|
||||
'status' => $this->status,
|
||||
'preferred_language' => $this->preferred_language,
|
||||
'email_verified_at' => $this->email_verified_at?->toIso8601String(),
|
||||
'phone_verified_at' => $this->phone_verified_at?->toIso8601String(),
|
||||
'last_login_at' => $this->last_login_at?->toIso8601String(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user