Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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'
  ]);
}
Comment

PREVIOUS NEXT
Code Example
Php :: send value from one page to another in php 
Php :: laravel make view 
Php :: how to convert array to string in php 
Php :: yii2 activeform 
Php :: php check string is int 
Php :: use auth automatic login on register 
Php :: laravel remove foreign key 
Php :: join in laravel eloquent 
Php :: php mac address 
Php :: php date first day of month and last month 
Php :: laravel sum relationship column 
Php :: IlluminateDatabaseEloquentCollection to array 
Php :: run shell script from php file 
Php :: php move file to another directory 
Php :: laravel get items by ids 
Php :: difference entre deux date php 
Php :: for in php 
Php :: remove text keep numbers only php 
Php :: How do I convert a string to a number in PHP? 
Php :: laravel 8 foreign key migration 
Php :: allow json uploads in Wordpress 
Php :: get absolute path php file 
Php :: import facade URL laravel 
Php :: laravel clone row 
Php :: php if mobile 
Php :: hello world php 
Php :: convert laravel hash password online 
Php :: return view in laravel controller 
Php :: php check if string contains words from array 
Php :: how to get last id in database 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =