{{-- @extends('layouts.app')
@section('content')
<!--begin::App Content Header-->
<div class="app-content-header">
    <!--begin::Container-->
    <div class="container-fluid">
      <!--begin::Row-->
      <div class="row">
        <div class="col-sm-6"><h3 class="mb-0">Bolt with Nuts-MS-M edit</h3></div>
        <div class="col-sm-6">
          <ol class="breadcrumb float-sm-end">
            <li class="breadcrumb-item"><a href="{{ route('admin/dashboard') }}">Home</a></li>
            <li class="breadcrumb-item active" aria-current="page">Bolt with Nuts-MS-M edit</li>
          </ol>
        </div>
      </div>
      <!--end::Row-->
    </div>
    <!--end::Container-->
  </div>
    <!--begin::App Content-->
    <div class="app-content">
        <!--begin::Container-->
        <div class="container-fluid">
            @if (Session::has('success'))
                <div class="alert alert-success alert-dismissible fade show" role="alert">
                    {{ Session::get('success') }}
                    @php
                        Session::forget('success');
                    @endphp
                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                </div>
            @endif
            <!--begin::Row-->
            <div class="row g-4">
                <div class="col-md-12">
                    <!--begin::Quick Example-->
                    <div class="card card-primary card-outline mb-4">
                      <!--begin::Header-->
                      <div class="card-header">

                        <div class="row">
                            <div class="col-lg-11"></div>
                            <div class="col-lg-1"><button value="Back" type="Button" onclick="history.go(-1);" class="btn btn-info btn-sm">Back</button></div>
                        </div>
                        </div>
                      <!--end::Header-->
                        <form action="{{ route('admin/boltwithnuts/ms/update') }}" method="post">
                            @csrf
                            <div class="card-body">
                                <div class="row">
                                    @foreach ($edits as $edit)
                                    <input type="hidden" name="id" value="{{ $edit->id }}" readonly>
                                    <div class="col-lg-6 col-md-6">
                                        <label for="length">Length</label>
                                        <select class="form-select @error('length') is-invalid @enderror" name="length" id="length">
                                            <option selected="" disabled="" value="">Choose...</option>
                                            @foreach ($lengths as $length)
                                                <option value="{{ $length->id }}" {{ ($edit->length == $length->id) ? 'selected' : ''  }}>{{ $length->length }}</option>
                                            @endforeach
                                        </select>
                                        @error('length')
                                            <span class="text-danger">{{ $message }}</span>
                                        @enderror
                                    </div>
                                    <div class="col-lg-6 col-md-6">
                                        <label for="diameter">Diameter</label>
                                        <select class="form-select @error('diameter') is-invalid @enderror" name="diameter" id="diameter">
                                            <option selected="" disabled="" value="">Choose...</option>
                                            @foreach ($diameters as $diameter)
                                                <option value="{{ $diameter->id }}" {{ ($edit->diameter == $diameter->id) ? 'selected' : ''  }}>{{ $diameter->diameter }}</option>
                                            @endforeach
                                        </select>
                                        @error('diameter')
                                            <span class="text-danger">{{ $message }}</span>
                                        @enderror
                                    </div>
                                    <div class="mb-3">
                                        <label for="value">value</label>
                                        <input id="value" type="text" class="form-control @error('value') is-invalid @enderror" name="value" value="{{ $edit->value }}">
                                        @error('value')
                                            <span class="text-danger">{{ $message }}</span>
                                        @enderror
                                    </div>
                                    @endforeach
                                </div>
                            </div>

                                                <!--begin::Footer-->
                            <div class="card-footer">
                                <button type="submit" class="btn btn-primary">Submit</button>
                            </div>
                            <!--end::Footer-->
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--end::App Content-->
@endsection --}}

@extends('layouts.app')
@section('content')
<!--breadcrumb-->
<div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3">
    <div class="breadcrumb-title pe-3">Bolt with Nuts-MS-M Edit</div>
    <div class="ps-3">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb mb-0 p-0">
                <li class="breadcrumb-item"><a href="javascript:;">
                    {{-- <i class="bx bx-home-alt"></i> --}}
                </a>
                </li>
                <li class="breadcrumb-item active" aria-current="page">Bolt with Nuts-MS-M Bolt</li>
            </ol>
        </nav>
    </div>
</div>
<!--end breadcrumb-->
<div class="row">
    <div class="col-lg-12 mx-auto">
        <div class="card">
            <div class="card-header px-4 py-3">
                <div class="row">
                    <div class="col-lg-10"></div>
                    <div class="col-lg-2"><button value="Back" type="Button" onclick="history.go(-1);" class="btn btn-grd btn-grd-branding px-5 btn-sm">Back</button></div>
                </div>
            </div>
            <div class="card-body p-4">
                <form id="jQueryValidationForm" action="{{ route('admin/boltwithnuts/ms/update') }}" method="post">
                    @csrf

                    @foreach ($edits as $edit)
                    <div class="row mb-3">
                        <input type="hidden" name="id" value="{{ $edit->id }}" readonly>
                        <label for="input39" class="col-sm-3 col-form-label">Length</label>
                        <div class="col-sm-9">
                            <select class="form-select" id="input39" name="length">
                                <option selected disabled value>Choose...</option>
                                {{-- <option selected="" disabled="" value="">Choose...</option> --}}
                                @foreach ($lengths as $length)
                                    <option value="{{ $length->id }}" {{ ($edit->length == $length->id) ? 'selected' : ''  }}>{{ $length->length }}</option>
                                @endforeach
                            </select>
                            @error('length')
                                <span class="text-danger">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="row mb-3">
                        <label for="input39" class="col-sm-3 col-form-label">Diameter</label>
                        <div class="col-sm-9">
                            <select class="form-select" id="input39" name="diameter">
                                <option selected disabled value>Choose...</option>
                                {{-- <option selected="" disabled="" value="">Choose...</option> --}}
                                @foreach ($diameters as $diameter)
                                    <option value="{{ $diameter->id }}" {{ ($edit->diameter == $diameter->id) ? 'selected' : ''  }}>{{ $diameter->diameter }}</option>
                                @endforeach
                            </select>
                            @error('diameter')
                                <span class="text-danger">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    <div class="row mb-3">
                        <label for="input35" class="col-sm-3 col-form-label">Enter Value</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" id="input35" name="value" value="{{ $edit->value }}">
                            @error('value')
                                <span class="text-danger">{{ $message }}</span>
                            @enderror
                        </div>
                    </div>
                    @endforeach
                    <div class="row">
                        <label class="col-sm-3 col-form-label"></label>
                        <div class="col-sm-9">
                            <div class="d-md-flex d-grid align-items-center gap-3">
                                <button type="submit" class="btn btn-grd-primary px-4">Submit</button>
                            <button type="reset" class="btn btn-grd-info px-4">Reset</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!--end row-->
@endsection
