<form action="{{ isset($category) ? route('admin.categories.update', $category->id) : route('admin.categories.store') }}" method="POST">
    @csrf

    @if(isset($category))
        @method('PUT')
    @endif

    <div class="mb-3">
        <label class="form-label">Category Name</label>
        <input type="text" name="name" class="form-control" value="{{ old('name', $category->name ?? '') }}" required>
    </div>

    <button class="btn btn-success">
        {{ isset($category) ? 'Update' : 'Save' }}
    </button>
</form>
