I have the table like that
|----|--------|------------|--------|
| id | UserID | ExpDate | isUsed |
|----|--------|------------|--------|
| 1 | 1265 | 2019-09-08 | 0 |
|----|--------|------------|--------|
| 2 | 1265 | 2019-08-28 | 0 |
|----|--------|------------|--------|
| 3 | 1265 | null | 0 |
|----|--------|------------|--------|
| 4 | 1265 | null | 1 |
|----|--------|------------|--------|
| 5 | 1582 | 2019-09-07 | 0 |
|----|--------|------------|--------|
. . . .
. . . .
. . . .
I want to select rows that User = 1265 and isUsed = 0 and ( ExpDate > 2019-09-05 or ExpDate = null)
How to make these selection using laravel eloquent?
I've tried below but it selects all ExpDate is bigger than 2019-09-05 rows on table. Not filtered by UserID
Hak::whereNull('ExpDate')
->orWhere('ExpDate', '>', '2019-09-05')
->where('UserID', 23)
->get()