class ValidTermInterval implements ValidationRule (View source)

Validates that the end date of a term is within the valid interval based on the term type (Annual or Semester).

Methods

__construct(string $start_date, string $term)

Constructor.

void
validate(string $attribute, mixed $value, Closure $fail)

Validate the given attribute.

Details

__construct(string $start_date, string $term)

Constructor.

Parameters

string $start_date

Start date of the term (Y-m-d)

string $term

Term type ('Annual' or 'Semester')

void validate(string $attribute, mixed $value, Closure $fail)

Validate the given attribute.

Parameters

string $attribute

The attribute name being validated

mixed $value

The value of the attribute (end date)

Closure $fail

Closure to call on validation failure

Return Value

void