Import date field error

I am using Filament 3.2.2 with the built-in importer feature. One of the columns in the table I am trying to import is defined in the migration like this: $table->date('last_used')->nullable(); In the importer, the column is defined with: ImportColumn::make('last_used')->rules(['date']), In my CSV, this column is empty (null). I've tried importing mapping the column to the empty column in the CSV and also unsetting the auto-identified column back to 'select column' In both cases, I'm getting an error saying: The last used field must be a valid date. Is there a reason a nullable date field can't be null? Any way around this? Thanks
No description
2 Replies
c-monster
c-monsterOP11mo ago
It worked when I removed the ->rules() method, but I wish I could leave that for the case when the field isn't empty.
awcodes
awcodes11mo ago
Try rules->([‘nullable’, ‘date’]) It’s just following laravel’s rules convention.
Want results from more Discord servers?
Add your server