src/FieldBuilder.php
protected function getOptionsFromModel($name)
    {
        $model = $this->form->getModel();

        if (is_null($model)) {
            return array();
        }

        $method = 'get'.Str::studly($name).'Options';

        if (method_exists($model, $method)) {
            return $model->$method();
        }

        return array();
    }
protected function getOptionsFromModel($name)
    {
        $model = $this->form->getModel();

        if (is_null($model)) {
            return array();
        }

        $method = 'get'.Str::studly($name).'Options';

        if (method_exists($model, $method)) {
            return $model->$method();
        }

        return array();
    }
protected function getOptionsFromModel ( $ name ) { $ model = $ this -> form -> getModel ( ) ; if ( is_null ( $ model ) ) { return array ( ) ; } $ method = 'get' . Str :: studly ( $ name ) . 'Options' ; if ( method_exists ( $ model , $ method ) ) { return $ model -> $ method ( ) ; } return array ( ) ; }
Attempt to get the option list from the model

The model needs to be set and have a method with the following convention:

attribute -> get[Attribute]Options, i.e.:
user_id -> getUserIdOptions()

Otherwise it will return an empty array

@param $name

@return mixed
Attempt to get the option list from the model