Overtrue\Validation\Validator::validateAccepted PHP Method

validateAccepted() protected method

This validation rule implies the attribute is "required".
protected validateAccepted ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
return boolean
    protected function validateAccepted($attribute, $value)
    {
        $acceptable = ['yes', 'on', '1', 1, true, 'true'];
        return $this->validateRequired($attribute, $value) && in_array($value, $acceptable, true);
    }
Validator