histories are a little messed, will change the logic in the future (techdebt)

This commit is contained in:
Edd
2025-12-30 01:49:39 +00:00
parent c456c9482f
commit 4f391e3638
12 changed files with 726 additions and 239 deletions
+9 -1
View File
@@ -58,12 +58,20 @@ class AuthController extends Controller
return response()->json(['message' => 'Nickname already registered'], 409);
}
$avatarFilename = null;
if ($request->hasFile('photo_avatar_filename')) {
$file = $request->file('photo_avatar_filename');
$path = $file->store('photos_avatars', 'public');
$avatarFilename = basename($path);
}
$user = User::create([
'email' => $request->email,
'nickname' => $request->nickname,
'name' => $request->name,
'password' => bcrypt($request->password),
'photo_avatar_filename' => $request->photo,
'photo_avatar_filename' => $avatarFilename,
'type' => 'P',
'blocked' => false,
'coins_balance' => 10,
+1 -1
View File
@@ -26,7 +26,7 @@ class RegisterRequest extends FormRequest
'nickname' => 'required|string|max:255',
'name' => 'required|string|max:255',
'password' => 'required|string|min:3',
'photo' => 'nullable|string',
'photo' => 'nullable|image|mimes:jpeg,png,jpg,gif|max:2048',
];
}
}
+16 -3
View File
@@ -1,6 +1,6 @@
### Get All Students (Login)
# @name login
POST http://localhost:8000/api/login
POST http://localhost:8000/api/v1/login
Content-Type: application/json
Accept: application/json
@@ -9,11 +9,24 @@ Accept: application/json
"password": "123"
}
### Capture the token
### Capture the token & id
@token = {{login.response.body.token}}
@id = {{login.response.body.user.id}}
### Get All matches
GET http://localhost:8000/api/matches
GET http://localhost:8000/api/v1/matches
Content-Type: application/json
Accept: application/json
Authorization: Bearer {{token}}
### Get me user
GET http://localhost:8000/api/v1/users/me
Content-Type: application/json
Accept: application/json
Authorization: Bearer {{token}}
### Get me matches
GET http://localhost:8000/api/v1/users/{{id}}/matches
Content-Type: application/json
Accept: application/json
Authorization: Bearer {{token}}