【发布时间】:2014-01-09 12:11:05
【问题描述】:
我有类似$user->albums()->where('col', NULL) 的东西,它工作正常,然后我尝试使用$user->albums()->where('col', NULL)->or_where('col', '') 将其扩展为空字符串,但它不起作用。
我还看到on this post 我可以使用where_null('col'),但它不起作用和it's not documented。任何简单的方法来选择哪里为空或 NULL col
【问题讨论】:
-
只是给未来用户的提示,解决方案是 whereNull('column'),如您在laravel.com/docs/5.7/queries#unions中看到的那样
标签: php orm relationship eloquent