Laravel 多数据插入错误
SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: “ for column ‘unit_id’ at row 2 (SQL: insert into
product_prices
(created_at
,product_id
,unit_id
,updated_at
) 值 (2016-12-06 06:56:01, 27, 1,2016-12-06 06:56:01), (2 -12-06 06:56:01,27, , 2016-12-06 06:56:01))
但是我的 unit_id
字段在 nullable();
请有人帮我这里 column_name=unit_id
原文由 Al-Amin 发布,翻译遵循 CC BY-SA 4.0 许可协议
我通过使用像这样的验证器函数解决了它: