Laravel Image Ratio Validation

[Solved] Laravel Image Ratio Validation | Php - Code Explorer | yomemimo.com
Question : laravel image ratio validation

Answered by : bright-badger-qw8ifelk02zt

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

Source : | Last Update : Mon, 08 Mar 21

Answers related to laravel image ratio validation

Code Explorer Popular Question For Php