diff --git a/backend/app/Admin/Controllers/ProfileController.php b/backend/app/Admin/Controllers/ProfileController.php new file mode 100644 index 00000000..39d81669 --- /dev/null +++ b/backend/app/Admin/Controllers/ProfileController.php @@ -0,0 +1,19 @@ +successResponse(new ExpertResource(Auth::user())); + } +} diff --git a/backend/app/Admin/Resources/ExpertResource.php b/backend/app/Admin/Resources/ExpertResource.php new file mode 100644 index 00000000..b7c86e1c --- /dev/null +++ b/backend/app/Admin/Resources/ExpertResource.php @@ -0,0 +1,24 @@ + + */ + public function toArray(Request $request): array + { + return [ + 'id' => $this->id, + 'username' => $this->username, + 'email' => $this->email, + ]; + } +} + diff --git a/backend/app/User/Controller/Auth/AuthController.php b/backend/app/Http/Controllers/AuthController.php old mode 100755 new mode 100644 similarity index 82% rename from backend/app/User/Controller/Auth/AuthController.php rename to backend/app/Http/Controllers/AuthController.php index cbd4f33d..26598504 --- a/backend/app/User/Controller/Auth/AuthController.php +++ b/backend/app/Http/Controllers/AuthController.php @@ -1,13 +1,11 @@ successResponse(new UserResource($user)); + return $this->successResponse([ + 'id' => $user->id, + 'username' => $user->username, + 'email' => $user->email, + ]); } return $this->errorResponse(__('messages.incorrect_or_username_password')); diff --git a/backend/app/User/Requests/Auth/LoginRequest.php b/backend/app/Http/Requests/Auth/LoginRequest.php old mode 100755 new mode 100644 similarity index 77% rename from backend/app/User/Requests/Auth/LoginRequest.php rename to backend/app/Http/Requests/Auth/LoginRequest.php index d9b9c881..592e8920 --- a/backend/app/User/Requests/Auth/LoginRequest.php +++ b/backend/app/Http/Requests/Auth/LoginRequest.php @@ -1,7 +1,8 @@ + * @return array */ public function rules(): array { diff --git a/backend/app/User/Requests/Auth/RegisterRequest.php b/backend/app/Http/Requests/Auth/RegisterRequest.php old mode 100755 new mode 100644 similarity index 81% rename from backend/app/User/Requests/Auth/RegisterRequest.php rename to backend/app/Http/Requests/Auth/RegisterRequest.php index 1c8055fe..9c7e9a84 --- a/backend/app/User/Requests/Auth/RegisterRequest.php +++ b/backend/app/Http/Requests/Auth/RegisterRequest.php @@ -1,7 +1,8 @@ + * @return array */ public function rules(): array { diff --git a/backend/app/User/Resources/UserResource.php b/backend/app/User/Resources/UserResource.php old mode 100755 new mode 100644 diff --git a/backend/routes/api.php b/backend/routes/api.php index 56897756..f35f6f84 100755 --- a/backend/routes/api.php +++ b/backend/routes/api.php @@ -1,10 +1,8 @@ user(); })->middleware('auth:api'); - diff --git a/backend/routes/web.php b/backend/routes/web.php index 8dc5599e..65362937 100755 --- a/backend/routes/web.php +++ b/backend/routes/web.php @@ -1,6 +1,6 @@