@extends('admin.master')

@section('title')
    Edit Policy Category
@endsection

@section('content')
    <div class="card card-custom " id="kt_card_4">
        <div class="card-header">
            <h3 class="card-title">
                Edit Policy Category
            </h3>
        </div>
        <form class="form" action="{{ route('policycategories.update', $policycategory->id) }}" method="POST" enctype="multipart/form-data">
            @csrf
            @method('PUT')
            <div class="card-body">
                <div class="form-group row">
                    <div class="col-md-12">
                        <label>Policy Category Title: <span class="text-danger">*</span></label>
                        <input type="text" name="title" class="form-control mb-2" placeholder="Enter policy category title here" value="{{ old('title', $policycategory->title) }}" required />
                    </div>
                    @error('title')
                        <span class="text-danger">{{ $message }}</span>
                    @enderror
                </div>

                <div class="form-group row">
                    <div class="col-lg-12">
                        <label>Policy Category Description:</label>
                        <textarea name="description" rows="5" class="form-control" placeholder="Enter policy category description">{{ old('description', $policycategory->description) }}</textarea>
                        @error('description')
                            <span class="text-danger">{{ $message }}</span>
                        @enderror
                    </div>
                </div>
            </div>
            <div class="card-footer">
                <div class="row">
                    <div class="col-lg-12 text-center">
                        <button type="submit" class="btn btn-success mr-2">Update Policy Category</button>
                        <a href="{{ route('policycategories.index') }}" class="btn btn-secondary">Cancel</a>
                    </div>
                </div>
            </div>
        </form>
    </div>
@endsection
