vendredi 1 novembre 2019

laravel validator not validating image image dimensions correct

I am trying to validate the image width and height. it is giving error even if user select image of correct resolution.

controller code

$messages = [
         'productImages.dimensions' => "Profile image must be maximum 100x100 "
     ];
      $this->validate($request,[
     'productName'           => 'required|max:40',
     'productDescription'    => 'required|max:1000',
     'productCondition'      => 'required',
     'productImages' =>     'required|max:5|dimensions:max_width=100,max_height=100',
     'category'              => 'required'
      ],$messages);

I want to submit that image when user select image of correct resolution.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire