<x-app-layout>
    <x-slot name="header">
        <h2 class="font-semibold text-xl text-gray-800 leading-tight">
            {{ __('Edit kela') }}
        </h2>
    </x-slot>

    <div class="py-12">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                <div class="p-6">


    <div class="card max-w-xl mx-auto p-6">
        <h2 class="text-xl font-bold text-primary mb-4">Edit Kelas</h2>
        <form action="{{ route('kelas.update', $kela) }}" method="POST">
            @csrf
            @method('PUT')
            <div class="mb-3">
                <label class="font-semibold">Nama Kelas</label>
                <input type="text" name="nama_kelas" class="form-control rounded" value="{{ old('nama_kelas', $kela->nama_kelas) }}" required>
                @error('nama_kelas')<div class="text-red-600 text-sm mt-1">{{ $message }}</div>@enderror
            </div>
            <div class="mb-3">
                <label class="font-semibold">Wali Kelas</label>
                <select name="wali_kelas_id" class="form-control rounded">
                    <option value="">Pilih Wali Kelas</option>
                    @foreach($gurus as $guru)
                        <option value="{{ $guru->id }}" {{ old('wali_kelas_id', $kela->wali_kelas_id)==$guru->id?'selected':'' }}>{{ $guru->nama }}</option>
                    @endforeach
                </select>
                @error('wali_kelas_id')<div class="text-red-600 text-sm mt-1">{{ $message }}</div>@enderror
            </div>
            <div class="flex gap-2 mt-4">
                <button type="submit" class="btn-primary">Update</button>
                <a href="{{ route('kelas.index') }}" class="btn-accent">Kembali</a>
            </div>
        </form>
    
            
</x-app-layout> 
