protected function getFileValidationRules()
    {
        $rules = array_get($this->field->options, 'validation', []);

        // If the 'image' rule is not set, make sure it is added.
        if (is_string($rules)) {
            if (empty($rules)) {
                $rules = 'image';
            } elseif ( ! preg_match('#(^|\|)image($|\|)#', $rules)) {
                $rules .= '|image';
            }
        } elseif ( ! in_array('image', $rules)) {
            array_unshift($rules, 'image');
        }

        return $rules;
    }
protected function getFileValidationRules()
    {
        $rules = array_get($this->field->options, 'validation', []);

        // If the 'image' rule is not set, make sure it is added.
        if (is_string($rules)) {
            if (empty($rules)) {
                $rules = 'image';
            } elseif ( ! preg_match('#(^|\|)image($|\|)#', $rules)) {
                $rules .= '|image';
            }
        } elseif ( ! in_array('image', $rules)) {
            array_unshift($rules, 'image');
        }

        return $rules;
    }
protected function getFileValidationRules ( ) { $ rules = array_get ( $ this -> field -> options , 'validation' , [ ] ) ; // If the 'image' rule is not set, make sure it is added. if ( is_string ( $ rules ) ) { if ( empty ( $ rules ) ) { $ rules = 'image' ; } elseif ( ! preg_match ( '#(^|\|)image($|\|)#' , $ rules ) ) { $ rules .= '|image' ; } } elseif ( ! in_array ( 'image' , $ rules ) ) { array_unshift ( $ rules , 'image' ) ; } return $ rules ; }
Returns validation rules that should be applied to the uploaded file.

@return string|array
Returns validation rules that should be applied to the uploaded file .