src/Lego/Widget/Concerns/HasFields.php
public function required($fields = [])
    {
        $fields = $fields ?: $this->fields();

        foreach ($fields as $field) {
            if (is_string($field)) {
                $this->field($field)->required();
                continue;
            }

            /* @var Field $field */
            $field->required();
        }

        return $this;
    }
public function required($fields = [])
    {
        $fields = $fields ?: $this->fields();

        foreach ($fields as $field) {
            if (is_string($field)) {
                $this->field($field)->required();
                continue;
            }

            /* @var Field $field */
            $field->required();
        }

        return $this;
    }
public function required ( $ fields = [ ] ) { $ fields = $ fields ? : $ this -> fields ( ) ; foreach ( $ fields as $ field ) { if ( is_string ( $ field ) ) { $ this -> field ( $ field ) -> required ( ) ; continue ; } /* @var Field $field */ $ field -> required ( ) ; } return $ this ; }
Mark Fields as Required.

@param array[]|Field[] $fields

@return $this
Mark Fields as Required .