F
Filamentβ€’8mo ago
Mike Scott

Importer fails rows with blank email fields when the email rule is applied to the column

I generated an importer and it intelligently added the email rule to an email column. The email column is not required - empty emails are allowed. However, the import fails on the email rule when the email is empty. So for a non-required email field, the email rule is useless. Apologies if I'm missing something obvious. Is there a way around this?
Solution:
Figured it out immediately after posting πŸ˜† The solution is to add a nullable rule to the column along with the 'email' rule: ```php ImportColumn::make('email')...
Jump to solution
1 Reply
Solution
Mike Scott
Mike Scottβ€’8mo ago
Figured it out immediately after posting πŸ˜† The solution is to add a nullable rule to the column along with the 'email' rule:
ImportColumn::make('email')
->rules(['nullable', 'email']),
ImportColumn::make('email')
->rules(['nullable', 'email']),
Want results from more Discord servers?
Add your server