Answers for "laravel image size validation"

PHP
1

image dimension when uploading in laravel validation

$this->validate($request, [    'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048|dimensions:width=500,height=500',]);
Posted by: Guest on April-23-2021
2

laravel validate max file size

$validator = Validator::make($request->all(), [
    'file' => 'max:500000',
]);
Posted by: Guest on May-05-2020
0

laravel image ratio validation

// ImageController
public function postImage(Request $request)
{
  $this->validate($request, [
    'avatar' => 'dimensions:min_width=250,min_height=500'
  ]);

  // or... 

  $this->validate($request, [
    'avatar' => 'dimensions:min_width=500,max_width=1500'
  ]);

  // or...

  $this->validate($request, [
    'avatar' => 'dimensions:width=100,height=100'
  ]);

  // or...

  // Ensures that the width of the image is 1.5x the height
  $this->validate($request, [
    'avatar' => 'dimensions:ratio=3/2'
  ]);
}
Posted by: Guest on March-01-2021
0

laravel image max size validation

max:10000 //10MB
Posted by: Guest on June-17-2021

Code answers related to "laravel image size validation"

Browse Popular Code Answers by Language