The multiselect
field type stores an array of selections from a list of options. The multiselect field type also supports callable options.
// streams/users.json
"fields": {
"picks": {
"type": "multiselect",
"config": {
"options": {
"star": "Star",
"circle": "Circle",
"umbrella": "Umbrella",
"triangle": "Triangle"
}
}
}
}
Besides basic array and associated arrays, you may specify a callable string:
{
"type": "multiselect",
"config": {
"options": "\\App\\CustomOptions@handle"
}
}
The $type
can be injected in order aid in returning options:
// app/CustomOptions.php
class CustomOptions
{
public function handle($type)
{
return [
'foo' => 'Foo',
'bar' => 'Bar',
];
}
}
{
"picks": ["circle", "triangle"]
}
Basic value access displays the stored key value:
@verbatim// Basic access
[{{ implode(', ', $entry->picks) }}]@endverbatim
Multiselect types also provide decorated values.
@verbatim// Decorated value
[{{ implode(',' $entry->picks()->values()) }}]@endverbatim
@todo Generate methods from @docs
@todo Generate config options from class::configuration
A blank TALL-stack Laravel project with Streams.
The fundamental features and utilities offered by the Streams platform.
A universal and extensible RESTful API for Streams.
Extensible, user-friendly, and performant control panel, components, and services.
Dev tooling for Laravel Streams.