@extends('layouts.app')

@section('title','Edit Kategori')

@section('content')

<div class="container" style="max-width:720px">
      <div class="card-modern p-4">
            <h3 class="mb-2">Edit Kategori</h3>

            @if($errors->any())
                  <div class="alert alert-danger"><ul class="mb-0">@foreach($errors->all() as $err)<li>{{ $err }}</li>@endforeach</ul></div>
            @endif

            <form action="{{ route('kategori.update',$kategori->id) }}" method="POST">
                  @csrf @method('PUT')
                  <div class="floating-label mb-3">
                        <input type="text" name="nama_kategori" class="input-rounded form-control" placeholder=" " value="{{ old('nama_kategori',$kategori->nama_kategori) }}" required>
                        <label>Nama Kategori</label>
                  </div>

                  <div class="d-flex gap-2">
                        <button type="submit" class="btn btn-primary">Simpan</button>
                        <a href="{{ route('kategori.index') }}" class="btn btn-outline-secondary">Batal</a>
                  </div>
            </form>
      </div>
</div>

@endsection