<?php
use App\Http\Controllers\AuthController;
use App\Http\Controllers\StudentsController;
use App\Http\Controllers\CountriesController;
use App\Http\Controllers\EventsController;
use App\Http\Controllers\PaymentsController;

Route::post('/login', [AuthController::class, 'login']);
Route::post('/reset-password', [AuthController::class, 'resetPassword'])->middleware('auth:sanctum');
// routes/api.php
Route::middleware('auth:sanctum')->post('/logout', [AuthController::class, 'logout']);

Route::middleware('auth:sanctum')->group(function () {
    // Students
    Route::get('/students', [StudentsController::class, 'index']);
    Route::get('/students/{id}', [StudentsController::class, 'show']);
    Route::post('/students', [StudentsController::class, 'store']);
    Route::put('/students/{id}', [StudentsController::class, 'update']);
    Route::delete('/students/{id}', [StudentsController::class, 'destroy']);
    Route::get('/student/search/{query}', [StudentsController::class, 'search']);

    // Countries
    Route::get('/countries', [CountriesController::class, 'index']);

    // Events
    Route::get('/events', [EventsController::class, 'index']);

    // Payments
    Route::get('/payments', [PaymentsController::class, 'index']);

});
