Attainly/backend/routes/api.php

28 lines
1.2 KiB
PHP

<?php
use App\Http\Controllers\AuthController;
use App\Http\Controllers\SetController;
use App\Http\Controllers\ScheduleController;
use App\Http\Middleware\AuthMiddleware;
use Illuminate\Support\Facades\Route;
Route::post('/login', [AuthController::class, 'login']);
Route::post('/signup', [AuthController::class, 'signup']);
Route::post('/confirm-email', [AuthController::class, 'confirmEmail']);
Route::middleware(AuthMiddleware::class)->group(function (): void {
Route::get('/me', [AuthController::class, 'me']);
Route::get('/sets', [SetController::class, 'index']);
Route::get('/sets/{setId}', [SetController::class, 'show'])
->whereNumber('setId');
Route::get('/assignments', [ScheduleController::class, 'assignments']);
Route::patch(
'/assignments/{assignmentId}',
[ScheduleController::class, 'updateAssignment'],
)->whereNumber('assignmentId');
Route::post('/schedules', [ScheduleController::class, 'store']);
Route::get('/schedules', [ScheduleController::class, 'index']);
Route::get('/schedules/{scheduleId}', [ScheduleController::class, 'show'])
->whereNumber('scheduleId');
Route::post('/logout', [AuthController::class, 'logout']);
});