@extends('layouts.app') @section('content')
<div class="container">
    <h2> Оформление заказа </h2>
</div>

<div class="container blocks">
    <div class="product">
        <div class="image">
            <img src="{{ url('storage/img/' . $product->filename) }}">
        </div>
        <div class="text">
            <h2>{{$product->name}}</h2>
            <p>{{$product->description}}</p>
            <p><b>{{$product->price}} ₽</b></p>
            <hr>
            <form method="POST" action="{{ route('order_send') }}">
                @csrf

                <div class="form-group row">

                    <p><b>Адрес доставки</b></p>
                    <input id="user_id" type="hidden" name="user_id" value="{{ $user_id }}">
                    <input id="product_id" type="hidden" name="product_id" value="{{ $product->id }}">
                    <input id="date" type="hidden" name="date" value="{{ $date }}">
                    <input id="address" type="address" class="form-control @error('address') is-invalid @enderror" name="address" value="{{ old('address') }}" required autocomplete="address" autofocus>

                    @error('address')
                    <span class="invalid-feedback" role="alert">
                        <strong>{{ $message }}</strong>
                    </span>
                    @enderror
                </div>

                <div class="form-group row mb-0">
                    <button type="submit" class="btn btn-primary">
                        Оформить заказ
                    </button>
                </div>
            </form>
        </div>

    </div>
</div>

@endsection
