@extends('Admin.layout.app')

@section('title','Add Product')
@section('page-title','Add Product')

@section('content')


<div class="container">
    <div class="card">
        <div class="card-header">
            <h4>Add Product</h4>
        </div>

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

                <div class="mb-3">
                    <label class="form-label">Product Name</label>
                    <input type="text"
                           name="name"
                           class="form-control @error('name') is-invalid @enderror"
                           value="{{ old('name') }}"
                           required>

                    @error('name')
                        <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>

                <div class="mb-3">
                    <label class="form-label">Price</label>
                    <input type="number"
                           name="price"
                           class="form-control @error('price') is-invalid @enderror"
                           value="{{ old('price') }}"
                           step="0.01"
                           min="0"
                           required>

                    @error('price')
                        <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>

                <div class="mb-3">
                        <label for="category" class="form-label">
                            Category <span class="text-danger">*</span>
                        </label>

                        <select class="form-select"
                                id="category"
                                name="category"
                                required>
                            <option value="">Select Category</option>
                            <option value="1">Food</option>
                            <option value="2">Cattring</option>
                        </select>
                    </div>


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


