Admin input with two selects

Installs: 1 136

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0


v1.2.2 2023-10-25 20:33 UTC

This package is auto-updated.

Last update: 2024-05-25 22:03:40 UTC


Old-fashioned component with left column with available options, right column with selected ones and some buttons to move elements between those. Has filter fields to look up for the elements in the columns.


composer require gurucomkz/doubleselectrelation
composer vendor-expose


$offersList = Offers::get();
$offersSelector = DoubleSelectRelation::create('Offers', null, $offersList);
$fields->addFieldToTab('Root.Main', $offersSelector);

Select custom Title

Declare a field (i.e. LongTitle) or a getter (i.e. getLongTitle()) in your model and do like this:

DoubleSelectRelation::create('Offers', null, $offersList)

Enable preview

You may want to let users check out the options before working with them. It can be done like this:

DoubleSelectRelation::create('Offers', null, $offersList)

It will create a button in every line, which by clicking will display a readonly CMS form in a modal box.

Additionally, you can declare method getPreviewCMSFields() in your related model to make a totally custom preview form.


  • Checks for changes and reporting to the form to trigger "Save" button activation
  • Some API maybe for programmatic control over options?