requiredWithDefault

Shortcut method to mark a field as required and provide a default value.

This is useful when you want to ensure a field is always present in the schema, but provide a fallback value if it's missing from the actual config file.

Example:

field(AppConfig::timeout).requiredWithDefault(30)

Return

this FieldConfigScope for method chaining

Parameters

value

the default value to use if the field is missing