Support the ongoing development of Laravel.io →
Configuration Forms Input
Last updated 8 months ago.
0
moderator Solution
if (max_count < uploadedImages.length + 1) {

-1 will always be less than the length.

Maybe you want something like

if (max_count != -1 && max_count < uploadedImages.length + 1) {
1
Solution selected by @th3ang3l

You are right this way is working correct if (max_count != -1 && max_count < uploadedImages.length + 1) {

1

Sign in to participate in this thread!

LaraJobs

Your banner here too?

luckydead th3ang3l Joined 22 Apr 2022

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 Laravel.io - All rights reserved.