ALOKUR's avatar

Laravel excel validate two columns' combination is not duplicate

I have a requirement wherein I need to ensure that Excel file being uploaded by user does not have duplicate rows w.r.t. 2 particular columns.

Example:

In the table below, I want to flag out that row 1 and 2 contain duplicate combination of COMPANY_CODE and CLERK_CODE:

COMPANY_CODE CLERK_CODE CLERK_NAME 123 A Johny 123 A Rocky 123 B Micky

If such duplicate combination is found I want to reject the entire file being imported and let the user know where the problem is.

Any clues?

0 likes
0 replies

Please or to participate in this conversation.