protected function getMorphableModelsForFieldData(ModelFormFieldDataInterface $data)
    {
        $modelsOption = array_get($data->options(), 'models', []);

        // Users may have set the string value with the model class, instead of a class => array value pair
        $modelClasses = array_map(
            function ($key, $value) {
                if (is_string($value)) {
                    return $value;
                }

                return $key;
            },
            array_keys($modelsOption),
            array_values($modelsOption)
        );

        return array_unique($modelClasses);
    }
protected function getMorphableModelsForFieldData(ModelFormFieldDataInterface $data)
    {
        $modelsOption = array_get($data->options(), 'models', []);

        // Users may have set the string value with the model class, instead of a class => array value pair
        $modelClasses = array_map(
            function ($key, $value) {
                if (is_string($value)) {
                    return $value;
                }

                return $key;
            },
            array_keys($modelsOption),
            array_values($modelsOption)
        );

        return array_unique($modelClasses);
    }
protected function getMorphableModelsForFieldData ( ModelFormFieldDataInterface $ data ) { $ modelsOption = array_get ( $ data -> options ( ) , 'models' , [ ] ) ; // Users may have set the string value with the model class, instead of a class => array value pair $ modelClasses = array_map ( function ( $ key , $ value ) { if ( is_string ( $ value ) ) { return $ value ; } return $ key ; } , array_keys ( $ modelsOption ) , array_values ( $ modelsOption ) ) ; return array_unique ( $ modelClasses ) ; }
Returns the model class names that the model may be related to.

@param ModelFormFieldDataInterface|ModelFormFieldData $data
@return string[]
Returns the model class names that the model may be related to .