Extension(string $extension)
Validates if the file extension matches the expected one:
v::extension('png')->assert('image.png');
// Validation passes successfullyThis validator is case-sensitive.
| Mode | Template |
|---|---|
default |
{{subject}} must have the {{extension}} extension |
inverted |
{{subject}} must not have the {{extension}} extension |
| Placeholder | Description |
|---|---|
extension |
|
subject |
The validated input or the custom validator name (if specified). |
- File system
| Version | Description |
|---|---|
| 3.0.0 | Templates changed |
| 1.0.0 | Created |