<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\DB;

class AnneeEtudeController extends Controller
{
    public function index(): JsonResponse
    {
        $annees = DB::connection('tenant')
            ->table('anneeetude') 
            ->select('id', 'annee_etude') // adapte aux vrais champs
            ->orderBy('id')
            ->get();

        return response()->json([
            'success' => true,
            'data' => $annees
        ]);
    }
}
