I was trying to get some records of a table, which has a column 'UpdateDate' with default value NULL. I need to check if a record exists that either 'UpdateDate' is not today or 'UpdateDate' is NULL. The query I built is as follows:
DB::table('Users')
->where('id', '=', '10')
->where(function($query) {
$query->where('UpdateDate','<>',date("Y-m-d"))->orWhere('UpdateDate','is','NULL'); })
->exists()
It didn't work as expected. How should I modify it? Thanks.