Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SigalZ's avatar
Level 5

exclude_if rule does not work

Hello, Using laravel 12 and the package: Laravel Excel.

https://docs.laravel-excel.com/3.1/imports/validation.html

I have an excel file with these column names:

Batch, Time, Profile, Beans, In (g), Out (g)

I need to validate rows only if the value in the Batch column is not: SUM

The problem I have is that the validations happen even if the value in the column is SUM. I get the errors on the row where the value in the column Batch is SUM.

I tried 3 different ways:

My import class:

Please help.

0 likes
4 replies
Glukinho's avatar

Can it be first letter case issue? Your column is Batch while rule refers to batch. Try to change the rule:

'beans' => ['exclude_if:Batch,SUM', ...
SigalZ's avatar
Level 5

Thank you but that's not the problem, the package changes the column names to lowercase.

SigalZ's avatar

Thank you very much, that was it :)

Please or to participate in this conversation.