isAttributeRequired() public method
Returns a value indicating whether the attribute is required.
This is determined by checking if the attribute is associated with a required validation rule in the current $scenario.
Note that when the validator has a conditional validation applied using $when this method will return false
regardless of the when
condition because it may be called be before the model is loaded with data.
public boolean isAttributeRequired ( $attribute ) | ||
---|---|---|
$attribute | string |
Attribute name |
return | boolean |
Whether the attribute is required |
Please login to continue.