<x-app-layout>
    <x-slot name="header">
        <h2 class="font-semibold text-xl text-gray-800 leading-tight">
            {{ __('Edit mata pelajaran') }}
        </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">


    <h2>Edit Mata Pelajaran</h2>
    <form action="{{ route('mata_pelajarans.update', $mataPelajaran) }}" method="POST">
        @csrf
        @method('PUT')
        <div class="mb-3">
            <label>Kode Mapel</label>
            <input type="text" name="kode_mapel" class="form-control" value="{{ old('kode_mapel', $mataPelajaran->kode_mapel) }}" required>
            @error('kode_mapel')<div class="text-danger">{{ $message }}</div>@enderror
        </div>
        <div class="mb-3">
            <label>Nama Mapel</label>
            <input type="text" name="nama_mapel" class="form-control" value="{{ old('nama_mapel', $mataPelajaran->nama_mapel) }}" required>
            @error('nama_mapel')<div class="text-danger">{{ $message }}</div>@enderror
        </div>
        <button type="submit" class="btn btn-primary">Update</button>
        <a href="{{ route('mata_pelajarans.index') }}" class="btn btn-secondary">Kembali</a>
    </form>

        </div>
    </div>
</x-app-layout> 
