Multi-Select

Dropdown that lets users pick multiple options with min/max constraints.

Multi-select fields let users choose multiple options from a dropdown. Like single selects, options can be static or loaded from enums, models or custom resolvers.

Basic Usage (Static Options)

Add a multi-select field with static options using the addMultiSelect() builder method:

app/Models/Survey.php

Available Settings

SettingTypeDescription
placeholderstringPlaceholder text shown when no options are selected
min_selectedintegerMinimum number of options that must be selected
max_selectedintegerMaximum number of options that can be selected
optionsarrayStatic key-value pairs for options
option_sourcestringDynamic option source (enum, model or resolver class)

Dynamic Options

Multi-select fields support the same dynamic option sources as select fields:

From Enum

From Model

Validation Constraints

Use minSelected() and maxSelected() to control how many options users can pick:

The SelectFieldValidator validates multi-select fields and checks:

  • At least min_selected options are selected (if set)
  • No more than max_selected options are selected (if set)
  • All selected values exist in the available options
  • For model-based options, all IDs exist in the database

Frontend Behavior

  • Selected options appear as removable tags/chips
  • Dropdown shows checkboxes for each option
  • Type to search/filter available options
  • Click outside or press Escape to close dropdown
  • Remove individual selections by clicking the X on each tag
  • Clear all button when multiple options are selected
  • Shows count of selected items (e.g., "3 selected")
  • Disables options when max_selected is reached

Submitted Data Format

Multi-select fields submit their values as a JSON array of selected option keys:

{
  "interests": ["tech", "design", "marketing"]
}

When using model-based options, the array contains model IDs:

{
  "tags": ["01HXXX...", "01HYYY...", "01HZZZ..."]
}

When to Use

Use Multi-Select For:

  • Skills, interests or categories
  • Tags or labels
  • Features or preferences (3-10 options)
  • Related entities (e.g., assign multiple tags)

Use Checkbox Group For:

  • Small option lists (2-5 items)
  • Options that should all be visible
  • Binary yes/no for multiple items
  • When space is not a constraint

Accessibility

Multi-select fields include ARIA attributes, keyboard navigation and screen reader announcements for the number of selected items and available options.