$this->validate($request,[ 'name' => 'required|unique:categories', 'images' => 'required|mimes:jpeg,bmp,png,jpg'

PHP
$this->validate($request, ['file' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',]);

Source

Also in PHP: