@extends('backend.admin.layouts.app')
@section('content')
    <div class="pagetitle">
        <h1>Dashboard</h1>
        <nav>
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                <li class="breadcrumb-item">Dashboard</li>
                <li class="breadcrumb-item active">{{ $PageTitle }}</li>

            </ol>
        </nav>
    </div><!-- End Page Title -->

    <section class="section dashboard">
        <div class="row">
            <div class="col-lg-6">
                <div class="card">
                    <div class="card-body mt-3">
                        <form action="{{ route('admin.store-location.update', $storeLocation->id) }}" method="POST" enctype="multipart/form-data">
                            @csrf
                            @method('PUT')

                            <div class="row mb-3">
                                <label for="store_name" class="col-sm-2 col-form-label">Store</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control @error('store_name') is-invalid @enderror"
                                        value="{{ $storeLocation->name }}" name="store_name" id="store_name" required>
                                </div>
                            </div>
                           
                            <div class="row mb-3">
                                <label for="address" class="col-sm-2 col-form-label">Address</label>
                                <div class="col-sm-10">
                                    <textarea class="form-control @error('address') is-invalid @enderror" cols="30" rows="2" name="address" id="address" required>{{ $storeLocation->address }}</textarea>
                               
                                </div>
                            </div>
                            <div class="row mb-3">
                                <label for="image" class="col-sm-2 col-form-label">Image</label>
                                <div class="col-sm-10 mb-25">
                                    <div class="upload-img-box">
                                        <img src="{{ asset('storage/' . $storeLocation->image)}}">
                                        <input type="file" name="image" id="image"
                                            accept="image/*" onchange="previewFile(this)">
                                        <div class="upload-img-box-icon">
                                            <i class="fa-solid fa-camera"></i>
                                        </div>
                                    </div>
                                    <p class="col-sm-10 mt-2"></p>
                                </div>
                            </div>

                            <div class="row mb-3">
                                <div class="col-sm-10">
                                    <button type="submit" class="btn btn-primary">Update</button>
                                </div>
                            </div>

                        </form><!-- End General Form Elements -->

                    </div>
                </div>

            </div>
        </div>
    </section>
@endsection
@push('style')
    <style>
        .upload-img-box {
            width: 200px;
            height: 200px;
        }
    </style>
@endpush
