Closed thanosalexander closed 7 years ago
How do you call whereRaw? As I see NeoEloquent does not override the method.
I know! Thats why i open the ticket, if it will be added!
I actually meant that it is not absolutely necessary that NeoEloquent overrides the method. It seems that the second param bindings
produces the error. That's why I wanted to see how you call whereRaw.
eg i want users that doesnt have articles
User::whereRaw(' NOT (article)->[:HAS_ARTICLE]->()' )->get()
i tried with laravel's built in doesntHave and has but with no success
If i could run this command inside whereRaw,it will be ok
After looking at line 778 in Builder.php, I think it's a bug. whereRaw
doesn't need bindings but the method addBinding
expects that the binding-array has a size of minimum one.
Only for testing: can you uncomment the if-block where the exception is thrown? Or you can add && count($value) > 0
in line 775 after the is_array($value)
.
Yes, i uncomment this
if (is_array($value)){ $key = array_keys($value)[0]; if (strpos($key, '.') !== false) { $binding = $value[$key]; unset($value[$key]); $key = explode('.', $key)[1]; $value[$key] = $binding; } }
and SUCCESS!! I think it must be added,its usefull
I tried to use whereRaw inside a query but with no success!
ErrorException in Builder.php line 778: Undefined offset: 0
Is there support for this?