Skip to content

Browser ​

The browser input type opens an inline record browser that lets users search and pick records from another module route. Used internally by the Creator feature and can appear in any form.

Files:

  • PHP: src/Hydrates/Inputs/BrowserHydrate.php
  • Vue: vue/src/js/components/inputs/Browser.vue

Hydrate ​

Class: BrowserHydrate
Config type: browser
Output type: input-browser

When _moduleName and _routeName are both set, the hydrate resolves endpoint automatically from the module's index action URL. Otherwise, provide endpoint directly.

Default Requirements ​

KeyDefaultDescription
itemValue'id'Field used as the record identifier
itemTitle'name'Field displayed for each record
defaultnullDefault selected value
returnObjectfalseReturn the full object instead of just the value
label'Browser'Input label
multiplefalseAllow selecting multiple records
maxnullMaximum selectable records (when multiple: true)
objectModelValues['*']Model attributes to include in the returned object
objectIdDefinernullCustom attribute to use as the record identifier

Config Usage ​

Basic — auto-resolved endpoint ​

php
[
    'type'        => 'browser',
    'name'        => 'author_id',
    'label'       => 'Author',
    '_moduleName' => 'Blog',
    '_routeName'  => 'Author',
]

Manual endpoint ​

php
[
    'type'     => 'browser',
    'name'     => 'author_id',
    'label'    => 'Author',
    'endpoint' => '/admin/blog/authors',
]

Multiple selection with a limit ​

php
[
    'type'        => 'browser',
    'name'        => 'author_ids',
    'label'       => 'Authors',
    '_moduleName' => 'Blog',
    '_routeName'  => 'Author',
    'multiple'    => true,
    'max'         => 3,
]

Vue Component ​

Component: VInputBrowser (v-input-browser)
File: vue/src/js/components/inputs/Browser.vue

Opens a paginated search dialog to browse and select records from a remote endpoint. Supports single and multiple selection, returnObject mode, and preserves initial values across re-renders.

Props ​

PropTypeDefaultDescription
modelValue*—Selected value or array of values
endpointString—API URL to fetch records from
itemValueString'id'Key used as the value for each record
itemTitleString'name'Key displayed for each record
multipleBooleanfalseAllow selecting multiple records
returnObjectBooleanfalseEmit the full object instead of only the value
objectIdDefinerString—Override which key identifies a record when returnObject is true
objectModelValuesArray['*']Keys to include from the record when returnObject is true
convertObjectBooleanfalseConvert returned object to a flat value after selection
itemsArray[]Pre-populate the browser list (skips initial fetch)
pageNumber1Starting page
lastPageNumber-1Total page count (set by server response)
itemsPerPageNumber20Records per page
withArray[]Eager-load relations on each record
scopesArray[]Query scopes to apply on the server
ordersArray[]Order definitions { key, direction }
appendsArray[]Model appends to include in the response
columnArray[]Columns to select
searchKeysArray—Keys the search field filters by
variantString'outlined'Vuetify input variant
densityString'comfortable'Vuetify input density
rulesString|Array[]Validation rules
useFullUrlBooleanfalseUse the full absolute URL when building requests
preserveInitialValuesBooleantrueKeep previously selected values when the list reloads

Behavior ​

  • Opens a dialog with a paginated, searchable list of records fetched from endpoint.
  • On open, if modelValue already contains IDs, those records are fetched by ids param and shown as pre-selected.
  • Pagination — loads the next page via infinite scroll or page navigation; appends results to the existing list.
  • Return modes — when returnObject: false (default), emits the itemValue of selected records; when returnObject: true, emits the full record object filtered by objectModelValues.
  • Multiple — when multiple: false, selecting a record immediately closes the dialog and emits the value.

See Also ​