@extends('layouts.app')
@section('title')编辑-承运商@endsection

@section('content')
    <div id="nav2">
        @component('maintenance.menu')
        @endcomponent
        @component('maintenance.carrier.menu')
                <li class="nav-item">
                    <a class="nav-link" href="{{URL::current()}}" :class="{active:isActive('edit',4)}">修改</a>
                </li>
        @endcomponent
    </div>
    <div class="container-fluid">
        <div class="card">
            <div class="card-body">
                <form method="POST" action='{{url("maintenance/carrier/{$carrier->id}")}}'>
                    @csrf
                    @method('PUT')
                    <div class="form-group row">
                        <label for="name" class="col-2 col-form-label text-right">承运商名称</label>
                        <div class="col-8">
                            <input type="text" class="form-control @error('Carrier.name') is-invalid @enderror"
                                   name="Carrier[name]" autocomplete="off" value="{{old('Carrier')['name']?old('Carrier')['name']:$carrier->name}}">
                            @error('Carrier.name')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $errors->first('Carrier.name') }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="mobile" class="col-2 col-form-label text-right">承运商电话</label>
                        <div class="col-8">
                            <input type="text" class="form-control @error('Carrier.mobile') is-invalid @enderror"
                                   name="Carrier[mobile]" autocomplete="off" value="{{old('Carrier')['mobile']?old('Carrier')['mobile']:$carrier->mobile}}">
                            @error('Carrier.mobile')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $errors->first('Carrier.mobile') }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="delivery_fee" class="col-2 col-form-label text-right">送货费</label>
                        <div class="col-8">
                            <input type="text" class="form-control @error('Carrier.delivery_fee') is-invalid @enderror"
                                   name="Carrier[delivery_fee]" autocomplete="off" value="{{old('Carrier')['delivery_fee']?old('Carrier')['delivery_fee']:$carrier->delivery_fee}}">
                            @error('Carrier.delivery_fee')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $errors->first('Carrier.delivery_fee') }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="remark" class="col-2 col-form-label text-right">备注</label>
                        <div class="col-8">
                            <textarea  class="form-control "
                                       name="Carrier[remark]" autocomplete="off" >{{old('Carrier')['remark']?old('Carrier')['remark']:$carrier->remark}}</textarea>
                        </div>
                    </div>
                    <div class="form-group row">
                        <div class="col-8 offset-2">
                            <input type="submit" class="btn btn-outline-dark form-control">
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection
