@extends('layouts.app')

@section('content')
<div class="container-xxl flex-grow-1 container-p-y">
    <div class="card">

        <div class="card-header">
            <div class="row align-items-center">
                <div class="col-md-6">
                    <h5 class="mb-0">Add Cattle Category</h5>
                </div>

                <div class="col-md-6 text-end">
                    <a href="{{ route('cattle-categories.index') }}" class="btn btn-secondary">
                        Back
                    </a>
                </div>
            </div>
            <hr />
        </div>

        <div class="card-body">
            <form action="{{ route('cattle-categories.store') }}" method="POST">
                @csrf

                <div class="mb-3">
                    <label class="form-label">Title</label>
                    <input type="text"
                           name="title"
                           value="{{ old('title') }}"
                           class="form-control"
                           placeholder="Enter category title">

                    @error('title')
                        <small class="text-danger">{{ $message }}</small>
                    @enderror
                </div>

                <div class="mb-3">
                    <label class="form-label">Start Date</label>
                    <input type="date"
                           name="start_date"
                           value="{{ old('start_date') }}"
                           class="form-control">

                    @error('start_date')
                        <small class="text-danger">{{ $message }}</small>
                    @enderror
                </div>

                <div class="mb-3">
                    <label class="form-label">End Date</label>
                    <input type="date"
                           name="end_date"
                           value="{{ old('end_date') }}"
                           class="form-control">

                    @error('end_date')
                        <small class="text-danger">{{ $message }}</small>
                    @enderror
                </div>

                <button type="submit" class="btn btn-primary">
                    Save
                </button>
            </form>
        </div>
    </div>
</div>
@endsection