@php
    $options = [
        'name_asc' => 'Name (Ascending)',
        'name_desc' => 'Name (Descending)',
        //'points_desc' => 'Most Points',
        //'points_asc' => 'Least Points',
    ];
    $keyword = trim(request()->get('keyword', ''));
    $selected = request()->get('sort', 'name_asc');
    if ($keyword) {
        $options = ['' => 'Relevance'];
        $selected = '';
    }
@endphp
<div class="panel panel-default panel-squared">
    <div class="panel-heading">
        <label for="sort" class="m-0">Sort</label>
    </div>
    <div class="panel-body">
        <select class="form-control" id="sort" name="sort">
            @foreach($options as $value => $text)
                <option value="{{ $value }}" @if ($value == $selected)selected="selected" @endif>{{ $text }}</option>
            @endforeach
        </select>
    </div>
</div>
