refactor: move backend in apps/backend
This commit is contained in:
1 parent
cf529278bd
commit
e2b471312c
178 files changed
+210
-193
No files matched your search
Executable
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace apps\backend\app\Services;
|
||||
use apps\backend\app\Models\User;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UserService
|
||||
{
|
||||
public static function getData(int $id) : array {
|
||||
|
||||
$user = User::findOrFail($id);
|
||||
|
||||
return [
|
||||
"id" => $user->id,
|
||||
"name" => $user->name,
|
||||
"lastname" => $user->lastname,
|
||||
"email" => $user->email,
|
||||
"role" => GetRole::getRole($user->role),
|
||||
"isAdmin" => ($user->role === 1 || $user->role === 2),
|
||||
"phone" => $user->phone,
|
||||
"created_at" => $user->created_at,
|
||||
"updated_at" => $user->updated_at,
|
||||
"verfied_at" => $user->verfied_at,
|
||||
"validate" => $user->validate,
|
||||
"tasks" => $user->tasks,
|
||||
"profile_photo_path" => $user->profile_photo_path,
|
||||
"email_notifications" => $user->email_notifications,
|
||||
"web_notifications" => $user->web_notifications,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user