@extends('layouts.app')
@section('content')
    <div class="content-wrapper">
        <!-- Content -->

        <div class="container-xxl flex-grow-1 container-p-y">
            <h4 class="fw-bold py-3 mb-4"><span class="text-muted fw-light">Site /</span> Settings </h4>

            <div class="row">
                <!-- Form controls -->
                <div class="col-md-3"></div>
                <div class="col-md-6">
                    <div class="card mb-4">
                        @if (session('success'))
                            <div class="alert alert-success">
                                {{ session('success') }}
                            </div>
                        @endif
                        <h5 class="card-header">Site Settings</h5>
                        <div class="card-body">
                            <form action="{{ route('admin.changesetting', $setting->id) }}" method="POST" enctype="multipart/form-data">
                                @csrf
                                <div class="mb-3">
                                    <label class="form-label" for="unit_price">Unit Price ( Default $9.90 )</label>
                                    <input type="text" class="form-control" name="unit_price"
                                        value="{{ old('unit_price', $setting->unit_price) }}" placeholder="Unit Price" />
                                    @if ($errors->has('unit_price'))
                                        <span class="text-danger">{{ $errors->first('unit_price') }}</span>
                                    @endif
                                </div>

                                <div class="mb-3">
                                    <label class="form-label">Persentage ( Default 4.5%)</label>
                                    <input type="text" class="form-control" name="persentage"
                                        placeholder="Enter Persentage" value="{{old('persentage', $setting->persentage)}}" />
                                    @if ($errors->has('persentage'))
                                        <span class="text-danger">{{ $errors->first('persentage') }}</span>
                                    @endif
                                </div>

                                <button type="submit" class="btn btn-primary">Update</button>
                            </form>
                        </div>

                    </div>
                </div>

            </div>
        </div>
    </div>
@endsection
