<style>

    #adv-search .dropdown.dropdown-lg {
        display: flex !important;
    }

    #adv-search #searchText {
        display: flex !important;
    }

    .dropdown.dropdown-lg .dropdown-menu {
        margin-top: -1px;
        padding: 6px 20px;
    }

    .input-group-btn .btn-group {
        display: flex !important;
        padding: 0 !important;
    }

    .btn-group .btn {
        border-radius: 0;
        margin-left: -1px;
    }

    .btn-group .btn:last-child {
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
    }

    .btn-group .form-horizontal .btn[type="submit"] {
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
    }

    .form-horizontal .form-group {
        margin-left: 0;
        margin-right: 0;
    }

    .form-group .form-control:last-child {
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
    }

    @media screen and (min-width: 768px) {
        #adv-search {
            width: 500px;
            /*margin: 0 auto;*/
        }

        .dropdown.dropdown-lg {
            position: static !important;
        }

        .dropdown.dropdown-lg .dropdown-menu {
            min-width: 500px;
        }
    }
</style>

{{--<form class="navbar-form" id="search-form" method="POST" action="{{ route('sphinx.search') }}" role="search">--}}
<form class="navbar-form" id="search-form" method="GET" action="{{ route('debug') }}" role="search">
    {{--<form id="search-form" method="POST" action="{{ route('sphinx.search') }}" role="search">--}}
    {{ csrf_field() }}
    <div class="input-group" id="adv-search">
        <input type="text" class="form-control" name="searchText" id="searchText"
               placeholder="Введите название предмета..."/>
        <div class="input-group-btn">
            <div class="btn-group" role="group">
                <div class="dropdown dropdown-lg">
                    <button type="button" class="btn btn-default dropdown-toggle"
                            data-toggle="dropdown" aria-expanded="true">
                        <span class="caret"></span>
                    </button>
<<<<<<< HEAD
                    <div class="dropdown-menu" role="menu">
                        <form class="form-horizontal" role="form">
                            <div class="form-group">
                                <label for="filter">Фильтр по категории</label>
                                <select id=filter" class="form-control" name="subCat" id="subCat" value="0">
                                    <option value="0" disabled selected hidden value="">Выберите категорию</option>
=======
                    <div class="dropdown-menu dropdown-menu-right" role="menu">
                        {{--<form class="form-horizontal" role="form">--}}
                            <div class="form-group">
                                <label for="filter">Фильтр по категории</label>
                                <select class="form-control" name="subCat" id="subCat" value="0">
                                    <option value="0" disabled selected hidden>Выберите категорию</option>
>>>>>>> a19ec2e3569a32850b671356e8c5f1686affdda3
                                    @isset($categories)
                                        @foreach($categories as $category)
                                            <optgroup label="{{ $category->title }}">
                                                @foreach($category->subcategory as $subcategory )
                                                    <option value="{{ $subcategory->id }}">{{ $subcategory->title }}</option>
                                                @endforeach
                                            </optgroup>
                                        @endforeach
                                    @endisset
                                </select>
                            </div>
                        {{--</form>--}}
                    </div>
                </div>
                <button class="btn btn-default" type="submit">
                    <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                </button>
            </div>
        </div>
    </div>
</form>