I am working on a laravel store image function. Fortunately it is working. But my problem is when I'm trying to upload atleast 20+ images. It only stores the first 20 images.
My question is, is there any settings that restricts my code to upload 20+ more files ?
Here is my code
public function storeImages($keycode, $projectsID){
if(!empty($_FILES[$keycode]['name']) && isset($_FILES[$keycode]) && is_array($_FILES[$keycode]['name'])):
for($i = 0; $i < count($_FILES[$keycode]['name']); $i++):
$filename = preg_replace("/[^a-z0-9A-Z\.]/","_",$_FILES[$keycode]['name'][$i]);
move_uploaded_file($_FILES[$keycode]['tmp_name'][$i],"uploads/projects/".$filename); //stores original size
try{
if(trim($filename) != ""){
$img = \Image::make("uploads/projects/".$filename); //opens the original sizes
$img->resize(200,200); // resize original
$img->save('uploads/projects/200x200_'.$filename); // save resize images
$new = array();
$new['id'] = \App\Helper\ModelHelper::uuid();
$new['project_id'] = $projectsID;
$new['type'] = "BEFORE";
$new['img_name'] = $filename;
DB::table("projects_photos")->insert($new);
}
}catch(Exception $e){
}
endfor;
endif;
}