A dropdown select (single value). For several values use Field::checkbox().
Field::select(string $key): SelectField->options(array $options): staticAssociative array of value => label. Required.
"active"(string)
Field::select('status')
->label('Status')
->options([
'draft' => 'Draft',
'active' => 'Active',
'archived' => 'Archived',
])
->default('draft')
->setIndex(true)
->adminColumn(true)
->quickEdit(true),{{ ctrlfield_get('status') }} {{-- returns 'active' --}}To display the label instead of the value, use the options array:
@php
$options = ['draft' => 'Draft', 'active' => 'Active', 'archived' => 'Archived'];
$value = ctrlfield_get('status');
@endphp
{{ $options[$value] ?? $value }}