<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Kelas;

class KelasController extends Controller
{
    // GET /api/kelas
    public function index()
    {
        $kelas = Kelas::all(['id', 'nama']);
        return response()->json($kelas);
    }

    // GET /api/kelas/{id}
    public function show($id)
    {
        $kelas = Kelas::find($id);
        if (!$kelas) {
            return response()->json(['message' => 'Kelas tidak ditemukan'], 404);
        }
        return response()->json($kelas);
    }
} 