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:
@@ -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']);
|
||||
});
|
||||
Reference in New Issue
Block a user