src/FormField/Lookup.php
public function addFilter($field, $label = null)
    {
        if (!$this->model->hasElement($field) instanceof \atk4\data\Field) {
            throw new \atk4\ui\Exception([
                'Unable to filter by non-existant field',
                'field'=> $field,
            ]);
        }
        $this->filters[] = ['field' => $field, 'label' => $label];
    }
public function addFilter($field, $label = null)
    {
        if (!$this->model->hasElement($field) instanceof \atk4\data\Field) {
            throw new \atk4\ui\Exception([
                'Unable to filter by non-existant field',
                'field'=> $field,
            ]);
        }
        $this->filters[] = ['field' => $field, 'label' => $label];
    }
public function addFilter ( $ field , $ label = null ) { if ( ! $ this -> model -> hasElement ( $ field ) instanceof \ atk4 \ data \ Field ) { throw new \ atk4 \ ui \ Exception ( [ 'Unable to filter by non-existant field' , 'field' => $ field , ] ) ; } $ this -> filters [ ] = [ 'field' => $ field , 'label' => $ label ] ; }
Add filter dropdown.

Ex: you need to restreint value available in city dropdown base on user input Country and language

$l = $form->addField('city',['Lookup']);
$l->addFilter('country_test', 'Country');
$l->addFilter('language', 'Lang');

This way, dropdown value will contains city corresponding to proper country and/or language.

@param $field
@param null $label
Add filter dropdown .