<?php /** @var \App\Models\Category $category */ ?>
<div class="form-group">
    <select class="form-select" name="category">
        <option value="" disabled {{ empty($selected) ? 'selected' : '' }} hidde*>
            Select a category...
        </option>
        @foreach($categories as $category)
            <option value="{{ $category->id }}" {{ in_array($category->id, (array) $selected) ? 'selected' : '' }}>
                {{ $category->name }}
            </option>
        @endforeach
    </select>
</div>
