Support the ongoing development of Laravel.io →
Configuration Forms Input
Last updated 2 years 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) {

th3ang3l liked this reply

1
Solution selected by @th3ang3l

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

tvbeek liked this reply

1

Sign in to participate in this thread!

Eventy

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.

© 2024 Laravel.io - All rights reserved.