Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Where null issue #52

Open
it-can opened this issue Oct 20, 2017 · 0 comments
Open

Where null issue #52

it-can opened this issue Oct 20, 2017 · 0 comments

Comments

@it-can
Copy link

it-can commented Oct 20, 2017

Laravel: 5.5.18

Hi I was testing this package and see some strange behavoir with nullable columns.
I have this query:

Invoice::search('fox')
            ->where('exported', null)
            ->get();

This generates a query like this:

select * from `invoice` where exported = '' AND (`name` LIKE '%fox%')

What I expect:

select * from `invoice` where exported = null AND (`name` LIKE '%fox%')

This is incorrect... Also adding a extra parameter to the where is incorrect:

Invoice::search('fox')
            ->where('exported', '!=', null)
            ->get();
select * from `invoice` where exported = '!=' AND (`name` LIKE '%fox%')

What I expect:

select * from `invoice` where exported != null AND (`name` LIKE '%fox%')
@it-can it-can changed the title Where issue Where null issue Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants