Create UserService

This commit is contained in:
T'JAMPENS QUENTIN p2406187
2025-12-05 15:08:18 +01:00
parent 7bf6ffe2f8
commit efd87bf5cd
2 changed files with 29 additions and 24 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Services;
use App\Models\User;
class UserService
{
public static function getData(int $id) : array {
$user = User::find($id);
return [
"id" => $user->id,
"name" => $user->name,
"lastname" => $user->lastname,
"email" => $user->email,
"role" => GetRole::getRole($user->role),
"phone" => $user->phone,
"created_at" => $user->created_at,
"updated_at" => $user->updated_at,
"verfied_at" => $user->verfied_at,
"validate" => $user->validate,
"tasks" => $user->tasks
];
}
}