Added routes, endpoints to get all matches, get a specific match, create a match, join a match, and update the match

This commit is contained in:
2025-12-18 20:29:10 +00:00
parent 5270e3c093
commit b485e19c9d
5 changed files with 235 additions and 8 deletions
+9
View File
@@ -3,6 +3,7 @@
use App\Http\Controllers\AuthController;
use App\Http\Controllers\GameController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\MatchController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
@@ -26,4 +27,12 @@ Route::middleware('auth:sanctum')->group(function () {
Route::post('/games/{game}/resign', [GameController::class, 'resign']);
Route::get('/users/{user}/matches', [UserController::class, 'getMatches']);
Route::post('games/{game}/join', [GameController::class, 'join']);
});
Route::middleware('auth:sanctum')->group(function () {
Route::get('matches', [MatchController::class, 'index']);
Route::post('matches', [MatchController::class, 'store']);
Route::get('matches/{match}', [MatchController::class, 'show']);
Route::post('matches/{match}/join', [MatchController::class, 'join']);
Route::put('matches/{match}', [MatchController::class, 'update']);
});