10
I saw tutorials on the internet that way you had to make a IS NULL
is the following:
Remessa::where('campo', 'IS', DB::raw('NULL'))->get();
But I was wondering about this, because if a ORM is usually developed thinking about creating a way to query the data that is compatible with all Dbms.
Although it works, I believe that the form highlighted above is not essential.
With the Eloquent
, there is some method (not to be highlighted above) that I can make a where
making the condition IS NULL
or IS NOT NULL
?
I believe that this current way ends up being repetitive.
I’m reading on the internet about Eloquent and Fluent. But sometimes I come across situations I need to use Fluent.
– Diego Souza
It’s the same thing except that in
Fluent
you start the query withDB::table
instead of Model– Wallace Maxters
Personally, I hate fluent. For me, who program in Laravel should use the Model, which is the abstraction, where you can configure the relationships and the like. Fluent no longer does this, he is to make queries more "raw", as is done in Codeigniter
– Wallace Maxters
Yes. I also don’t like to use Fluent.
– Diego Souza