protected function getEnumParams(Field $field)
    {
        if ($field->getEloquentDataMethod() != 'enum') {
            throw new Exception('The field type is not enum! Cannot create an enum column with no options.');
        }

        $labels = array_filter($field->getOptionsByLang(), function ($option) use ($field) {
            return !($field->isRequired() && $option->value == '');
        });

        $values = $this->getLabelValues($labels);

        if (count($values) == 0) {
            throw new Exception('Could not find any option values to construct the enum values from. ' .
                'It is possible that this field is required but only have option available has an empty string.');
        }

        return sprintf('[%s]', implode(',', Helpers::wrapItems($values)));
    }
protected function getEnumParams(Field $field)
    {
        if ($field->getEloquentDataMethod() != 'enum') {
            throw new Exception('The field type is not enum! Cannot create an enum column with no options.');
        }

        $labels = array_filter($field->getOptionsByLang(), function ($option) use ($field) {
            return !($field->isRequired() && $option->value == '');
        });

        $values = $this->getLabelValues($labels);

        if (count($values) == 0) {
            throw new Exception('Could not find any option values to construct the enum values from. ' .
                'It is possible that this field is required but only have option available has an empty string.');
        }

        return sprintf('[%s]', implode(',', Helpers::wrapItems($values)));
    }
protected function getEnumParams ( Field $ field ) { if ( $ field -> getEloquentDataMethod ( ) != 'enum' ) { throw new Exception ( 'The field type is not enum! Cannot create an enum column with no options.' ) ; } $ labels = array_filter ( $ field -> getOptionsByLang ( ) , function ( $ option ) use ( $ field ) { return ! ( $ field -> isRequired ( ) && $ option -> value == '' ) ; } ) ; $ values = $ this -> getLabelValues ( $ labels ) ; if ( count ( $ values ) == 0 ) { throw new Exception ( 'Could not find any option values to construct the enum values from. ' . 'It is possible that this field is required but only have option available has an empty string.' ) ; } return sprintf ( '[%s]' , implode ( ',' , Helpers :: wrapItems ( $ values ) ) ) ; }
Constructs the second parameter to the enum type method

@param CrestApps\CodeGenerator\Models\Field $field

@return string
Constructs the second parameter to the enum type method