public function determineValidationRules(ModelRelationData $relation, ModelFormFieldData $field)
    {
        $rules = [];

        if ($field->required() && ! $field->translated()) {
            $rules[] = 'required';
        } else {
            // Anything that is not required should by default be explicitly nullable
            // since Laravel 5.4.
            $rules[] = 'nullable';
        }

        // todo
        // make validation rules as far as possible, based on the key type (incrementing?)
        // or using exists:: ...

        return $rules;
    }
public function determineValidationRules(ModelRelationData $relation, ModelFormFieldData $field)
    {
        $rules = [];

        if ($field->required() && ! $field->translated()) {
            $rules[] = 'required';
        } else {
            // Anything that is not required should by default be explicitly nullable
            // since Laravel 5.4.
            $rules[] = 'nullable';
        }

        // todo
        // make validation rules as far as possible, based on the key type (incrementing?)
        // or using exists:: ...

        return $rules;
    }
public function determineValidationRules ( ModelRelationData $ relation , ModelFormFieldData $ field ) { $ rules = [ ] ; if ( $ field -> required ( ) && ! $ field -> translated ( ) ) { $ rules [ ] = 'required' ; } else { // Anything that is not required should by default be explicitly nullable // since Laravel 5.4. $ rules [ ] = 'nullable' ; } // todo // make validation rules as far as possible, based on the key type (incrementing?) // or using exists:: ... return $ rules ; }
Determines validation rules for given relation data.

@param ModelRelationData  $relation
@param ModelFormFieldData $field
@return array|false
Determines validation rules for given relation data .