Some further googling found two threads (one, two), but using DB::raw("NULL")
gave the same results - I get zero in the DB instead of null.
Unfortunately I can confirm as well... I have no idea how possible to insert NULL with using conditional parameters.
My problem seem like this: [...]
:discountPrice,
. .
array( "discountPrice" => ($product->sale === true)?$product->discountPrice:"NULL",
. .
[...]
I've tried with DB:raw("NULL") as well but no luck...
ehh... I've found the solution... :)
array( "discountPrice" => ($product->sale === true)?$product->discountPrice:NULL,
So the NULL is need without quote sign.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community