ElevationRule extends AbstractRangeRule
Ensures that a value represents a valid elevation (altitude) in meters.
The elevation must be a numeric value between -11500 (deepest ocean depth) and +8900 (above Mount Everest), inclusive.
Tags
Table of Contents
Properties
- $max : float|int
- Maximum allowed elevation (in meters).
- $message : string
- Custom error message.
- $min : float|int
- Minimum allowed elevation (in meters).
Methods
- check() : bool
- Check if the given value lies within the defined range.
- getMax() : float|int
- Gets the maximum bound.
- getMin() : float|int
- Gets the minimum bound.
Properties
$max
Maximum allowed elevation (in meters).
protected
float|int
$max
= 8900
$message
Custom error message.
protected
string
$message
= 'The :attribute must be a valid elevation between -11500 and 8900 meters.'
$min
Minimum allowed elevation (in meters).
protected
float|int
$min
= -11500
Methods
check()
Check if the given value lies within the defined range.
public
check(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolgetMax()
Gets the maximum bound.
public
getMax() : float|int
Return values
float|intgetMin()
Gets the minimum bound.
public
getMin() : float|int