Iam new in laravel .im trying to validate dimensions of image .i want dimensions minimum(width=100,height=50).iam using validation code in controller.php is here
'galimg'=>'required|max:200kb|DimensionMin(300,300)|Mimes:jpeg,jpg,gif,png
,pneg'
but DimensionMin(300,300) is not work....i think custom validation rule is possible ..but i dont know how to use it ?and where ? this is my controller.php code
public function getgallery()
{
$validate=Validator::make(Input::all(),array(
'galname'=>'required|max:20',
'galimg'=>'required|max:400kb|Dimensionmin(300,300)|Mimes:jpeg,jpg,gif,png
,pneg'));
if($validate->fails())
{ return Redirect::route('getgallery')
->withErrors($validate)->withInput(); }
else
{ $max_image = 3;
if(ForumGallery::all()->count() < $max_image)
{ $file=Input::file('galimg');
$filename=$file->getClientOriginalName();
$file->move('uploads',$filename);
ForumGallery::create(['galname'=>Input::get('galname'),
'galimg'=>$filename]);
return Redirect::route('addgallery');
}
else
{return Redirect::route('gallery')
->with('success','Max Image Upload Reached!');
} }}