<div class="mb-3">
    <label class="form-label">id Региона</label>
    <select class="form-select" name="region_id">
        <option>Выбрать регион</option>
        @foreach($regions as $region)
            <option value="{{$region->id}}" {{isset($project) && $project->region_id == $region->id ? 'selected' : ''}}>{{$region->id}}</option>
        @endforeach
    </select>
</div>
<div class="mb-3">
    <label class="form-label">Кол-во квартир:</label>
    <input type="number" name="apartments" class="form-control" placeholder="Кол-во квартир"
           value="{{$project->apartments ?? ''}}">
    @error('apartments')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>

<div class="mb-3">
    <label class="form-label">Кол-во этажей:</label>
    <input type="number" name="floors" class="form-control" placeholder="Кол-во этажей"
           value="{{$project->floors ?? ''}}">
    @error('floors')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <label class="form-label">Картинка карточки:</label>
    <input type="file" name="card_image" class="form-control" placeholder="Картинка карточки"
           value="{{$project->card_image ?? ''}}"><img src="/uploads/images/{{$project->card_image ?? ''}}">
    @error('card_image')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <label class="form-label">Фоновая картинка:</label>
    <input type="file" name="background_image" class="form-control" placeholder="Фоновая картинка"
           value="{{$project->background_image ?? ''}}"><img src="/uploads/images/{{$project->background_image ?? ''}}">
    @error('background_image')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <label class="form-label">Логотип:</label>
    <input type="file" name="logo" class="form-control" placeholder="Логотип"
           value="{{$project->logo ?? ''}}"><img src="/uploads/images/{{$project->logo ?? ''}}">
    @error('logo')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <label class="form-label">Статус проекта:</label>
    <input type="text" name="status" class="form-control" placeholder="Статус проекта" value="{{$project->status ?? '1'}}">
    @error('status')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <label class="form-label">3d-тур-1:</label>
    <input type="text" name="3d_tour_one" class="form-control" placeholder="3d-тур-1"
           value="{{isset($project) ? $project->getAttribute('3d_tour_one') : ''}}">
    @error('3d_tour_one')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <label class="form-label">3d-тур-2:</label>
    <input type="text" name="3d_tour_two" class="form-control" placeholder="3d-тур-2"
           value="{{isset($project) ? $project->getAttribute('3d_tour_two') : ''}}">
    @error('3d_tour_two')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <label class="form-label">Фото двора:</label>
    <input type="file" name="yard_image" class="form-control" placeholder="Фото двора"
           value="{{$project->yard_image ?? ''}}"><img src="/uploads/images/{{$project->yard_image ?? ''}}">
    @error('yard_image')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <label class="form-label">Фото вестибюля:</label>
    <input type="file" name="hall_image" class="form-control" placeholder="Фото вестибюля"
           value="{{$project->hall_image ?? ''}}"><img src="/uploads/images/{{$project->hall_image ?? ''}}">
    @error('hall_image')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <label class="form-label">Местонахождение:</label>
    <input type="text" name="location" class="form-control" placeholder="Местонахождение" value="{{$project->location ?? ''}}">
    @error('location')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="mb-3">
    <label class="form-label">slug:</label>
    <input type="text" name="slug" class="form-control" placeholder="Slug" value="{{$project->slug ?? ''}}">
    @error('slug')
    <div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
    @enderror
</div>
<div class="d-flex justify-content-between">
    <button type="submit" class="btn btn-primary me-2">
        @isset($project)
            Обновить
        @else
            Сохранить
        @endisset
    </button>
</div>
