Continuing his series looking at the features coming in Laravel 5.3, Matt Stauffer has posted his latest article in the series covering some of the image validation rules that the update will include.
In Laravel 5.3, we have a new validation option: image dimensions for image uploads. The validation rule is called dimensions, and you can pass the following parameters to it: min_width, max_width, min_height, max_height, width, height and ratio.
This provides a simplified version of many of these checks you might have been doing manually in the past (and fits in with the Laravel validation structure). He gives a few examples of verifying images from a basic form submission. The validations are put on the "avatar" field and work much like the other validation definitions with the checks "stacked" and separated by the pipe character ("|").